<!-- HTML header for doxygen 1.8.4-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
		<meta http-equiv="X-UA-Compatible" content="IE=9"/>
		<meta name="generator" content="Doxygen 1.8.4"/>
		<title>exceptions4c: e4c.h File Reference</title>
		<link href="tabs.css" rel="stylesheet" type="text/css"/>
		<link href="exceptions4c.css" rel="stylesheet" type="text/css" />
		<!-- <link href="sheep_016.png" rel="shortcut icon" /> -->
		<link href="" rel="shortcut icon">
		<script type="text/javascript" src="jquery.js"></script>
		<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
		<link href="exceptions4c.css" rel="stylesheet" type="text/css" />
	</head>
	<body>
		<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
				<div id="titlearea">
					<table cellspacing="0" cellpadding="0">
						<tbody>
							<tr style="height: 56px;">
									<td id="projectlogo"><img alt="Logo" src="sheep_064.png"/></td>
									<td style="padding-left: 0.5em;">
										<div id="projectname">
											exceptions4c
											&nbsp;
											<span id="projectnumber">version 3.0</span>
										</div>
											<div id="projectbrief">An exception handling framework for C</div>
									</td>
							</tr>
						</tbody>
				</table>
			</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('e4c_8h.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a>  </div>
  <div class="headertitle">
<div class="title">e4c.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>exceptions4c header file  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stdlib.h&gt;</code><br/>
<code>#include &lt;setjmp.h&gt;</code><br/>
<code>#include &lt;stdbool.h&gt;</code><br/>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structe4c__exception__type.html">e4c_exception_type</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents an exception type in the exception handling system.  <a href="structe4c__exception__type.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structe4c__exception.html">e4c_exception</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents an instance of an exception type.  <a href="structe4c__exception.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structe4c__signal__mapping.html">e4c_signal_mapping</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents a map between a signal and an exception.  <a href="structe4c__signal__mapping.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Exception handling keywords</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>This set of keywords express the semantics of exception handling. </p>
</div></td></tr>
<tr class="memitem:a28599e8ac99ea9faff60a2258a914aee"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a28599e8ac99ea9faff60a2258a914aee">try</a>&#160;&#160;&#160;E4C_TRY</td></tr>
<tr class="memdesc:a28599e8ac99ea9faff60a2258a914aee"><td class="mdescLeft">&#160;</td><td class="mdescRight">Introduces a block of code aware of exceptions.  <a href="#a28599e8ac99ea9faff60a2258a914aee">More...</a><br/></td></tr>
<tr class="separator:a28599e8ac99ea9faff60a2258a914aee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a629585c5169ebdb440b9015f8e87b4df"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a629585c5169ebdb440b9015f8e87b4df">catch</a>(exception_type)&#160;&#160;&#160;E4C_CATCH(exception_type)</td></tr>
<tr class="memdesc:a629585c5169ebdb440b9015f8e87b4df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Introduces a block of code capable of handling a specific type of exceptions.  <a href="#a629585c5169ebdb440b9015f8e87b4df">More...</a><br/></td></tr>
<tr class="separator:a629585c5169ebdb440b9015f8e87b4df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6f547472794c162cc629f53cd4db5454"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454">finally</a>&#160;&#160;&#160;E4C_FINALLY</td></tr>
<tr class="memdesc:a6f547472794c162cc629f53cd4db5454"><td class="mdescLeft">&#160;</td><td class="mdescRight">Introduces a block of code responsible for cleaning up the previous exception-aware block.  <a href="#a6f547472794c162cc629f53cd4db5454">More...</a><br/></td></tr>
<tr class="separator:a6f547472794c162cc629f53cd4db5454"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0593b0774c47f8424effd591c2e93921"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a0593b0774c47f8424effd591c2e93921">retry</a>(max_retry_attempts)&#160;&#160;&#160;E4C_RETRY(max_retry_attempts)</td></tr>
<tr class="memdesc:a0593b0774c47f8424effd591c2e93921"><td class="mdescLeft">&#160;</td><td class="mdescRight">Repeats the previous <code><a class="el" href="e4c_8h.html#a28599e8ac99ea9faff60a2258a914aee" title="Introduces a block of code aware of exceptions. ">try</a></code> (or <code><a class="el" href="e4c_8h.html#aeda5446032a08fece73ec569b861a72c" title="Closes a block of code with automatic disposal of a resource. ">use</a></code>) block entirely.  <a href="#a0593b0774c47f8424effd591c2e93921">More...</a><br/></td></tr>
<tr class="separator:a0593b0774c47f8424effd591c2e93921"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a482d649fcaafd28584629da3606e4ea7"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a482d649fcaafd28584629da3606e4ea7">throw</a>(exception_type, message)&#160;&#160;&#160;E4C_THROW(exception_type, message)</td></tr>
<tr class="memdesc:a482d649fcaafd28584629da3606e4ea7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Signals an exceptional situation represented by an exception object.  <a href="#a482d649fcaafd28584629da3606e4ea7">More...</a><br/></td></tr>
<tr class="separator:a482d649fcaafd28584629da3606e4ea7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc36ba3503172106c15ca4812ef80909"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#adc36ba3503172106c15ca4812ef80909">rethrow</a>(message)&#160;&#160;&#160;E4C_RETHROW(message)</td></tr>
<tr class="memdesc:adc36ba3503172106c15ca4812ef80909"><td class="mdescLeft">&#160;</td><td class="mdescRight">Throws again the currently thrown exception, with a new message.  <a href="#adc36ba3503172106c15ca4812ef80909">More...</a><br/></td></tr>
<tr class="separator:adc36ba3503172106c15ca4812ef80909"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Dispose pattern keywords</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>This set of keywords express the semantics of automatic resource acquisition and disposal. </p>
</div></td></tr>
<tr class="memitem:a4afea611dbbe18fc3e3665166b3cd7bc"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a4afea611dbbe18fc3e3665166b3cd7bc">with</a>(resource, dispose)&#160;&#160;&#160;E4C_WITH(resource, dispose)</td></tr>
<tr class="memdesc:a4afea611dbbe18fc3e3665166b3cd7bc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Opens a block of code with automatic disposal of a resource.  <a href="#a4afea611dbbe18fc3e3665166b3cd7bc">More...</a><br/></td></tr>
<tr class="separator:a4afea611dbbe18fc3e3665166b3cd7bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeda5446032a08fece73ec569b861a72c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#aeda5446032a08fece73ec569b861a72c">use</a>&#160;&#160;&#160;E4C_USE</td></tr>
<tr class="memdesc:aeda5446032a08fece73ec569b861a72c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Closes a block of code with automatic disposal of a resource.  <a href="#aeda5446032a08fece73ec569b861a72c">More...</a><br/></td></tr>
<tr class="separator:aeda5446032a08fece73ec569b861a72c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abe1fc0d5310579fdfe7cca02506d06c2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#abe1fc0d5310579fdfe7cca02506d06c2">using</a>(type, resource, args)&#160;&#160;&#160;E4C_USING(type, resource, args)</td></tr>
<tr class="memdesc:abe1fc0d5310579fdfe7cca02506d06c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Introduces a block of code with automatic acquisition and disposal of a resource.  <a href="#abe1fc0d5310579fdfe7cca02506d06c2">More...</a><br/></td></tr>
<tr class="separator:abe1fc0d5310579fdfe7cca02506d06c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeb7a4b6d23a08c92e14ce6f496ae6050"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#aeb7a4b6d23a08c92e14ce6f496ae6050">reacquire</a>(max_reacquire_attempts)&#160;&#160;&#160;E4C_REACQUIRE(max_reacquire_attempts)</td></tr>
<tr class="memdesc:aeb7a4b6d23a08c92e14ce6f496ae6050"><td class="mdescLeft">&#160;</td><td class="mdescRight">Repeats the previous <code><a class="el" href="e4c_8h.html#a4afea611dbbe18fc3e3665166b3cd7bc" title="Opens a block of code with automatic disposal of a resource. ">with</a></code> block entirely.  <a href="#aeb7a4b6d23a08c92e14ce6f496ae6050">More...</a><br/></td></tr>
<tr class="separator:aeb7a4b6d23a08c92e14ce6f496ae6050"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Integration macros</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>These macros are designed to ease the integration of external libraries which make use of the exception handling system. </p>
</div></td></tr>
<tr class="memitem:aaabdc92526a7fb8e02558867f3ad0cb8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#aaabdc92526a7fb8e02558867f3ad0cb8">E4C_VERSION_NUMBER</a></td></tr>
<tr class="memdesc:aaabdc92526a7fb8e02558867f3ad0cb8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provides the library version number.  <a href="#aaabdc92526a7fb8e02558867f3ad0cb8">More...</a><br/></td></tr>
<tr class="separator:aaabdc92526a7fb8e02558867f3ad0cb8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a28f15bc301e1a0a004040d0f2c196139"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a28f15bc301e1a0a004040d0f2c196139">E4C_VERSION_THREADSAFE</a></td></tr>
<tr class="memdesc:a28f15bc301e1a0a004040d0f2c196139"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provides the library thread mode (either single-thread or multi-thread)  <a href="#a28f15bc301e1a0a004040d0f2c196139">More...</a><br/></td></tr>
<tr class="separator:a28f15bc301e1a0a004040d0f2c196139"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a890f79613092dcd580078ff46babfb6e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a890f79613092dcd580078ff46babfb6e">E4C_VERSION_MAJOR</a></td></tr>
<tr class="memdesc:a890f79613092dcd580078ff46babfb6e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provides the library major version number.  <a href="#a890f79613092dcd580078ff46babfb6e">More...</a><br/></td></tr>
<tr class="separator:a890f79613092dcd580078ff46babfb6e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa4564247c8f8fa73e293f24e9790e2b5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#aa4564247c8f8fa73e293f24e9790e2b5">E4C_VERSION_MINOR</a></td></tr>
<tr class="memdesc:aa4564247c8f8fa73e293f24e9790e2b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provides the library minor version number.  <a href="#aa4564247c8f8fa73e293f24e9790e2b5">More...</a><br/></td></tr>
<tr class="separator:aa4564247c8f8fa73e293f24e9790e2b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a472fdc2124dfc3fc50680cbf5811c868"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a472fdc2124dfc3fc50680cbf5811c868">E4C_VERSION_REVISION</a></td></tr>
<tr class="memdesc:a472fdc2124dfc3fc50680cbf5811c868"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provides the library revision number.  <a href="#a472fdc2124dfc3fc50680cbf5811c868">More...</a><br/></td></tr>
<tr class="separator:a472fdc2124dfc3fc50680cbf5811c868"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aea131104dcb566c9e4d134c476758b2c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#aea131104dcb566c9e4d134c476758b2c">E4C_VERSION_STRING</a></td></tr>
<tr class="memdesc:aea131104dcb566c9e4d134c476758b2c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provides the library version number as a string literal.  <a href="#aea131104dcb566c9e4d134c476758b2c">More...</a><br/></td></tr>
<tr class="separator:aea131104dcb566c9e4d134c476758b2c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a221e306037ef73b1788ddd261088230f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a221e306037ef73b1788ddd261088230f">E4C_EXCEPTION_MESSAGE_SIZE</a>&#160;&#160;&#160;128</td></tr>
<tr class="memdesc:a221e306037ef73b1788ddd261088230f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provides the maximum length (in bytes) of an exception message.  <a href="#a221e306037ef73b1788ddd261088230f">More...</a><br/></td></tr>
<tr class="separator:a221e306037ef73b1788ddd261088230f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a67bf2b56660b4ddba6a66f7a54c4befd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a67bf2b56660b4ddba6a66f7a54c4befd">e4c_reusing_context</a>(status, on_failure)&#160;&#160;&#160;E4C_REUSING_CONTEXT(status, on_failure)</td></tr>
<tr class="memdesc:a67bf2b56660b4ddba6a66f7a54c4befd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reuses an existing exception context, otherwise, begins a new one and then ends it.  <a href="#a67bf2b56660b4ddba6a66f7a54c4befd">More...</a><br/></td></tr>
<tr class="separator:a67bf2b56660b4ddba6a66f7a54c4befd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae6ab0e5438f844f59155fee0ee92866f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#ae6ab0e5438f844f59155fee0ee92866f">E4C_ON_FAILURE</a>(handler)&#160;&#160;&#160;handler( <a class="el" href="e4c_8h.html#ab67ff2dbcdda36ef766b096e7198614d">e4c_get_exception</a>() )</td></tr>
<tr class="memdesc:ae6ab0e5438f844f59155fee0ee92866f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provides a means of parsing an exception to obtain a status value.  <a href="#ae6ab0e5438f844f59155fee0ee92866f">More...</a><br/></td></tr>
<tr class="separator:ae6ab0e5438f844f59155fee0ee92866f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a45c8b2837d07a0316df144169b6d57e5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a45c8b2837d07a0316df144169b6d57e5">E4C_NO_RETURN</a></td></tr>
<tr class="memdesc:a45c8b2837d07a0316df144169b6d57e5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Marks a function which never returns.  <a href="#a45c8b2837d07a0316df144169b6d57e5">More...</a><br/></td></tr>
<tr class="separator:a45c8b2837d07a0316df144169b6d57e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a38c22cb71d38cabd98aa850d4075e246"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a38c22cb71d38cabd98aa850d4075e246">E4C_UNREACHABLE_RETURN</a>(value)</td></tr>
<tr class="memdesc:a38c22cb71d38cabd98aa850d4075e246"><td class="mdescLeft">&#160;</td><td class="mdescRight">Simulates a function return.  <a href="#a38c22cb71d38cabd98aa850d4075e246">More...</a><br/></td></tr>
<tr class="separator:a38c22cb71d38cabd98aa850d4075e246"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc10e326f26beef709f69e2495d390f2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#adc10e326f26beef709f69e2495d390f2">E4C_UNREACHABLE_VOID_RETURN</a></td></tr>
<tr class="memdesc:adc10e326f26beef709f69e2495d390f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Simulates a function void return.  <a href="#adc10e326f26beef709f69e2495d390f2">More...</a><br/></td></tr>
<tr class="separator:adc10e326f26beef709f69e2495d390f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Other convenience macros</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>These macros provide a handy way to: begin (and end) implicitly a new exception context, express <em>assertions</em>, define and declare exceptions, and define arrays of signal mappings. </p>
</div></td></tr>
<tr class="memitem:a27678c11fa7d4e2a9436f527cc194013"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a27678c11fa7d4e2a9436f527cc194013">e4c_using_context</a>(handle_signals)&#160;&#160;&#160;E4C_USING_CONTEXT(handle_signals)</td></tr>
<tr class="memdesc:a27678c11fa7d4e2a9436f527cc194013"><td class="mdescLeft">&#160;</td><td class="mdescRight">Introduces a block of code which will use a new exception context.  <a href="#a27678c11fa7d4e2a9436f527cc194013">More...</a><br/></td></tr>
<tr class="separator:a27678c11fa7d4e2a9436f527cc194013"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acdcc5aaebf3f273c1762f24a6ece2e5e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#acdcc5aaebf3f273c1762f24a6ece2e5e">assert</a>(condition)&#160;&#160;&#160;E4C_ASSERT(condition)</td></tr>
<tr class="memdesc:acdcc5aaebf3f273c1762f24a6ece2e5e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Expresses a program assertion.  <a href="#acdcc5aaebf3f273c1762f24a6ece2e5e">More...</a><br/></td></tr>
<tr class="separator:acdcc5aaebf3f273c1762f24a6ece2e5e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a76c8e6dc2aec197fc2056b64d8e1c83e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a76c8e6dc2aec197fc2056b64d8e1c83e">throwf</a>(exception_type, format,...)</td></tr>
<tr class="memdesc:a76c8e6dc2aec197fc2056b64d8e1c83e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Throws an exception with a formatted message.  <a href="#a76c8e6dc2aec197fc2056b64d8e1c83e">More...</a><br/></td></tr>
<tr class="separator:a76c8e6dc2aec197fc2056b64d8e1c83e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abd7bd21e95cfdf7ef4f840abf0467887"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#abd7bd21e95cfdf7ef4f840abf0467887">rethrowf</a>(format,...)</td></tr>
<tr class="memdesc:abd7bd21e95cfdf7ef4f840abf0467887"><td class="mdescLeft">&#160;</td><td class="mdescRight">Throws again the currently thrown exception, with a new, formatted message.  <a href="#abd7bd21e95cfdf7ef4f840abf0467887">More...</a><br/></td></tr>
<tr class="separator:abd7bd21e95cfdf7ef4f840abf0467887"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afbe55946f07a3dca22879ad5832b2a19"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#afbe55946f07a3dca22879ad5832b2a19">E4C_DECLARE_EXCEPTION</a>(name)</td></tr>
<tr class="memdesc:afbe55946f07a3dca22879ad5832b2a19"><td class="mdescLeft">&#160;</td><td class="mdescRight">Declares an exception type.  <a href="#afbe55946f07a3dca22879ad5832b2a19">More...</a><br/></td></tr>
<tr class="separator:afbe55946f07a3dca22879ad5832b2a19"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aadc9f577bd369729df5aa614e54eedd8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#aadc9f577bd369729df5aa614e54eedd8">E4C_DEFINE_EXCEPTION</a>(name, default_message, supertype)</td></tr>
<tr class="memdesc:aadc9f577bd369729df5aa614e54eedd8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Defines an exception type.  <a href="#aadc9f577bd369729df5aa614e54eedd8">More...</a><br/></td></tr>
<tr class="separator:aadc9f577bd369729df5aa614e54eedd8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a598e01198e8ce022fdb32ae7145803f6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a598e01198e8ce022fdb32ae7145803f6">E4C_SIGNAL_MAPPING</a>(signal_number, exception_type)</td></tr>
<tr class="memdesc:a598e01198e8ce022fdb32ae7145803f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Maps a specific signal number to a given exception type.  <a href="#a598e01198e8ce022fdb32ae7145803f6">More...</a><br/></td></tr>
<tr class="separator:a598e01198e8ce022fdb32ae7145803f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acce379ab06acbdb14eb15e55cdba4631"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#acce379ab06acbdb14eb15e55cdba4631">E4C_IGNORE_SIGNAL</a>(signal_number)</td></tr>
<tr class="memdesc:acce379ab06acbdb14eb15e55cdba4631"><td class="mdescLeft">&#160;</td><td class="mdescRight">Ignores a specific signal number.  <a href="#acce379ab06acbdb14eb15e55cdba4631">More...</a><br/></td></tr>
<tr class="separator:acce379ab06acbdb14eb15e55cdba4631"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad9a799b298c1f39c427364bfc7bfb230"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#ad9a799b298c1f39c427364bfc7bfb230">E4C_NULL_SIGNAL_MAPPING</a></td></tr>
<tr class="memdesc:ad9a799b298c1f39c427364bfc7bfb230"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents a null signal mapping literal.  <a href="#ad9a799b298c1f39c427364bfc7bfb230">More...</a><br/></td></tr>
<tr class="separator:ad9a799b298c1f39c427364bfc7bfb230"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a06e18483913c9112424bc941e248a532"><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a06e18483913c9112424bc941e248a532">e4c_uncaught_handler</a> )(const <a class="el" href="structe4c__exception.html">e4c_exception</a> *exception)</td></tr>
<tr class="memdesc:a06e18483913c9112424bc941e248a532"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents a function which will be executed in the event of an uncaught exception.  <a href="#a06e18483913c9112424bc941e248a532">More...</a><br/></td></tr>
<tr class="separator:a06e18483913c9112424bc941e248a532"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ca7a4f5a33acd2bb2ed30a8d9b441de"><td class="memItemLeft" align="right" valign="top">typedef void *(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a8ca7a4f5a33acd2bb2ed30a8d9b441de">e4c_initialize_handler</a> )(const <a class="el" href="structe4c__exception.html">e4c_exception</a> *exception)</td></tr>
<tr class="memdesc:a8ca7a4f5a33acd2bb2ed30a8d9b441de"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents a function which will be executed whenever a new exception is thrown.  <a href="#a8ca7a4f5a33acd2bb2ed30a8d9b441de">More...</a><br/></td></tr>
<tr class="separator:a8ca7a4f5a33acd2bb2ed30a8d9b441de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad8b769fde61d9bc8154bff6939331042"><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#ad8b769fde61d9bc8154bff6939331042">e4c_finalize_handler</a> )(void *custom_data)</td></tr>
<tr class="memdesc:ad8b769fde61d9bc8154bff6939331042"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents a function which will be executed whenever an exception is destroyed.  <a href="#ad8b769fde61d9bc8154bff6939331042">More...</a><br/></td></tr>
<tr class="separator:ad8b769fde61d9bc8154bff6939331042"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a6cbf5662e61eccb04d74464ab3864d50"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50">e4c_status</a> { <a class="el" href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50ad78680d90dc3a7e42da9f2eb2ff8e4c9">e4c_succeeded</a>, 
<a class="el" href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50a8d27c3fe156c5e88b8927a45a99903c8">e4c_recovered</a>, 
<a class="el" href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50a3e25fc733de62745054a380444ada211">e4c_failed</a>
 }</td></tr>
<tr class="memdesc:a6cbf5662e61eccb04d74464ab3864d50"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents the completeness of a code block aware of exceptions.  <a href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50">More...</a><br/></td></tr>
<tr class="separator:a6cbf5662e61eccb04d74464ab3864d50"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Exception context handling functions</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>These functions enclose the scope of the exception handling system and retrieve the current exception context. </p>
</div></td></tr>
<tr class="memitem:a64b5cdb24278ff07e6f7767b68890473"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a64b5cdb24278ff07e6f7767b68890473">e4c_context_is_ready</a> (void)</td></tr>
<tr class="memdesc:a64b5cdb24278ff07e6f7767b68890473"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if the current exception context is ready.  <a href="#a64b5cdb24278ff07e6f7767b68890473">More...</a><br/></td></tr>
<tr class="separator:a64b5cdb24278ff07e6f7767b68890473"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1e27be2186952ed77b4591f48c5d11cd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a1e27be2186952ed77b4591f48c5d11cd">e4c_context_begin</a> (bool handle_signals)</td></tr>
<tr class="memdesc:a1e27be2186952ed77b4591f48c5d11cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Begins an exception context.  <a href="#a1e27be2186952ed77b4591f48c5d11cd">More...</a><br/></td></tr>
<tr class="separator:a1e27be2186952ed77b4591f48c5d11cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7fbe6fb51b19a6485f806c006711ec74"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a7fbe6fb51b19a6485f806c006711ec74">e4c_context_end</a> (void)</td></tr>
<tr class="memdesc:a7fbe6fb51b19a6485f806c006711ec74"><td class="mdescLeft">&#160;</td><td class="mdescRight">Ends the current exception context.  <a href="#a7fbe6fb51b19a6485f806c006711ec74">More...</a><br/></td></tr>
<tr class="separator:a7fbe6fb51b19a6485f806c006711ec74"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8fae2739e3fc3823624dc35d9ea396ae"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a8fae2739e3fc3823624dc35d9ea396ae">e4c_context_set_handlers</a> (<a class="el" href="e4c_8h.html#a06e18483913c9112424bc941e248a532">e4c_uncaught_handler</a> uncaught_handler, void *custom_data, <a class="el" href="e4c_8h.html#a8ca7a4f5a33acd2bb2ed30a8d9b441de">e4c_initialize_handler</a> initialize_handler, <a class="el" href="e4c_8h.html#ad8b769fde61d9bc8154bff6939331042">e4c_finalize_handler</a> finalize_handler)</td></tr>
<tr class="memdesc:a8fae2739e3fc3823624dc35d9ea396ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the optional handlers of an exception context.  <a href="#a8fae2739e3fc3823624dc35d9ea396ae">More...</a><br/></td></tr>
<tr class="separator:a8fae2739e3fc3823624dc35d9ea396ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a4c54a4d7cd10568b639749e8ec0e1f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a8a4c54a4d7cd10568b639749e8ec0e1f">e4c_context_set_signal_mappings</a> (const <a class="el" href="structe4c__signal__mapping.html">e4c_signal_mapping</a> *mappings)</td></tr>
<tr class="memdesc:a8a4c54a4d7cd10568b639749e8ec0e1f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assigns the specified signal mappings to the exception context.  <a href="#a8a4c54a4d7cd10568b639749e8ec0e1f">More...</a><br/></td></tr>
<tr class="separator:a8a4c54a4d7cd10568b639749e8ec0e1f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7290cbfb8abb0b2ecf338cdb4de5d6df"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__signal__mapping.html">e4c_signal_mapping</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a7290cbfb8abb0b2ecf338cdb4de5d6df">e4c_context_get_signal_mappings</a> (void)</td></tr>
<tr class="memdesc:a7290cbfb8abb0b2ecf338cdb4de5d6df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves the signal mappings for the current exception context.  <a href="#a7290cbfb8abb0b2ecf338cdb4de5d6df">More...</a><br/></td></tr>
<tr class="separator:a7290cbfb8abb0b2ecf338cdb4de5d6df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a961e9d117c98424796ae769f2b2e6b26"><td class="memItemLeft" align="right" valign="top"><a class="el" href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50">e4c_status</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a961e9d117c98424796ae769f2b2e6b26">e4c_get_status</a> (void)</td></tr>
<tr class="memdesc:a961e9d117c98424796ae769f2b2e6b26"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the completeness status of the executing code block.  <a href="#a961e9d117c98424796ae769f2b2e6b26">More...</a><br/></td></tr>
<tr class="separator:a961e9d117c98424796ae769f2b2e6b26"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab67ff2dbcdda36ef766b096e7198614d"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception.html">e4c_exception</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#ab67ff2dbcdda36ef766b096e7198614d">e4c_get_exception</a> (void)</td></tr>
<tr class="memdesc:ab67ff2dbcdda36ef766b096e7198614d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the exception that was thrown.  <a href="#ab67ff2dbcdda36ef766b096e7198614d">More...</a><br/></td></tr>
<tr class="separator:ab67ff2dbcdda36ef766b096e7198614d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Other integration and convenience functions</div></td></tr>
<tr class="memitem:ac84af6b4e6798e3cc98de0012dcacb7f"><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#ac84af6b4e6798e3cc98de0012dcacb7f">e4c_library_version</a> (void)</td></tr>
<tr class="memdesc:ac84af6b4e6798e3cc98de0012dcacb7f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the library version number.  <a href="#ac84af6b4e6798e3cc98de0012dcacb7f">More...</a><br/></td></tr>
<tr class="separator:ac84af6b4e6798e3cc98de0012dcacb7f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3f6c1f7c7b0765e1caea7fcda7641317"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a3f6c1f7c7b0765e1caea7fcda7641317">e4c_is_instance_of</a> (const <a class="el" href="structe4c__exception.html">e4c_exception</a> *instance, const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> *exception_type)</td></tr>
<tr class="memdesc:a3f6c1f7c7b0765e1caea7fcda7641317"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether an exception instance is of a given type.  <a href="#a3f6c1f7c7b0765e1caea7fcda7641317">More...</a><br/></td></tr>
<tr class="separator:a3f6c1f7c7b0765e1caea7fcda7641317"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad129f3e99e1483f691c8f3134f85740b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#ad129f3e99e1483f691c8f3134f85740b">e4c_print_exception</a> (const <a class="el" href="structe4c__exception.html">e4c_exception</a> *exception)</td></tr>
<tr class="memdesc:ad129f3e99e1483f691c8f3134f85740b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints a fatal error message regarding the specified exception.  <a href="#ad129f3e99e1483f691c8f3134f85740b">More...</a><br/></td></tr>
<tr class="separator:ad129f3e99e1483f691c8f3134f85740b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7b71c5d523540629e1a313bdf372b3ff"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a7b71c5d523540629e1a313bdf372b3ff">e4c_print_exception_type</a> (const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> *exception_type)</td></tr>
<tr class="memdesc:a7b71c5d523540629e1a313bdf372b3ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints an ASCII graph representing an exception type's hierarchy.  <a href="#a7b71c5d523540629e1a313bdf372b3ff">More...</a><br/></td></tr>
<tr class="separator:a7b71c5d523540629e1a313bdf372b3ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Predefined signal mappings</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>There is a predefined set of signal mappings.</p>
<p>Signal mappings are used to convert signals into exceptions.</p>
<p>Common signals are mapped to its corresponding exception, for example:</p>
<ul>
<li><code>SIGABRT</code> is mapped to <code><a class="el" href="e4c_8h.html#aa5e036c578fdf7577287f547cbc75234" title="This exception is thrown to abort the process. ">AbortException</a></code></li>
<li><code>SIGFPE</code> is mapped to <code><a class="el" href="e4c_8h.html#a6fcf200100e1cfde147d444aefe5cdb5" title="This exception is thrown when the process performs an erroneous arithmetic operation. ">ArithmeticException</a></code></li>
<li><code>SIGSEGV</code> is mapped to <code><a class="el" href="e4c_8h.html#aae2c0f060628a75c117ff4bf75f2804f" title="This exception is thrown when the process tries to dereference an invalid pointer. ">BadPointerException</a></code></li>
<li><code>SIGTERM</code> is mapped to <code><a class="el" href="e4c_8h.html#a85b12608ec4e14046622ebcaf38b925e" title="This exception is thrown to request the termination of the process. ">TerminationException</a></code></li>
<li>...and so on</li>
</ul>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="structe4c__signal__mapping.html" title="Represents a map between a signal and an exception. ">e4c_signal_mapping</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a1e27be2186952ed77b4591f48c5d11cd" title="Begins an exception context. ">e4c_context_begin</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a8a4c54a4d7cd10568b639749e8ec0e1f" title="Assigns the specified signal mappings to the exception context. ">e4c_context_set_signal_mappings</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a7290cbfb8abb0b2ecf338cdb4de5d6df" title="Retrieves the signal mappings for the current exception context. ">e4c_context_get_signal_mappings</a> </dd></dl>
</div></td></tr>
<tr class="memitem:ac4a53949d14a14386d0fd351e2d035eb"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__signal__mapping.html">e4c_signal_mapping</a> *const&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#ac4a53949d14a14386d0fd351e2d035eb">e4c_default_signal_mappings</a></td></tr>
<tr class="memdesc:ac4a53949d14a14386d0fd351e2d035eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">The array of predefined signal mappings.  <a href="#ac4a53949d14a14386d0fd351e2d035eb">More...</a><br/></td></tr>
<tr class="separator:ac4a53949d14a14386d0fd351e2d035eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Predefined exceptions</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>Built-in exceptions represent usual error conditions that might occur during the course of any program.</p>
<p>They are organized into a <em>pseudo-hierarchy</em>; <code><a class="el" href="e4c_8h.html#a07da936a74602281d601c171b77bf0b0" title="This is the root of the exception pseudo-hierarchy ">RuntimeException</a></code> is the common <em>supertype</em> of all exceptions. </p>
</div></td></tr>
<tr class="memitem:a07da936a74602281d601c171b77bf0b0"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a07da936a74602281d601c171b77bf0b0">RuntimeException</a></td></tr>
<tr class="memdesc:a07da936a74602281d601c171b77bf0b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is the root of the exception <em>pseudo-hierarchy</em>  <a href="#a07da936a74602281d601c171b77bf0b0">More...</a><br/></td></tr>
<tr class="separator:a07da936a74602281d601c171b77bf0b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:add75d60a1beb6be775c7199b58c8bf49"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#add75d60a1beb6be775c7199b58c8bf49">NotEnoughMemoryException</a></td></tr>
<tr class="memdesc:add75d60a1beb6be775c7199b58c8bf49"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown when the system runs out of memory.  <a href="#add75d60a1beb6be775c7199b58c8bf49">More...</a><br/></td></tr>
<tr class="separator:add75d60a1beb6be775c7199b58c8bf49"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1e4eb23ca08a70129f1a5076f37dce3e"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a1e4eb23ca08a70129f1a5076f37dce3e">IllegalArgumentException</a></td></tr>
<tr class="memdesc:a1e4eb23ca08a70129f1a5076f37dce3e"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown when a function is passed an illegal or inappropriate argument.  <a href="#a1e4eb23ca08a70129f1a5076f37dce3e">More...</a><br/></td></tr>
<tr class="separator:a1e4eb23ca08a70129f1a5076f37dce3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a64df4b96937a949466d55b5638c5b9cf"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a64df4b96937a949466d55b5638c5b9cf">AssertionException</a></td></tr>
<tr class="memdesc:a64df4b96937a949466d55b5638c5b9cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown when an assertion does not hold.  <a href="#a64df4b96937a949466d55b5638c5b9cf">More...</a><br/></td></tr>
<tr class="separator:a64df4b96937a949466d55b5638c5b9cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4ee8b42ef10e5adf967761811823150c"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a4ee8b42ef10e5adf967761811823150c">InputOutputException</a></td></tr>
<tr class="memdesc:a4ee8b42ef10e5adf967761811823150c"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown when an input/output error occurs.  <a href="#a4ee8b42ef10e5adf967761811823150c">More...</a><br/></td></tr>
<tr class="separator:a4ee8b42ef10e5adf967761811823150c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ad6290493086138a1d40a5d79cfed17"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a7ad6290493086138a1d40a5d79cfed17">SignalException</a></td></tr>
<tr class="memdesc:a7ad6290493086138a1d40a5d79cfed17"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is the common supertype of all signal exceptions.  <a href="#a7ad6290493086138a1d40a5d79cfed17">More...</a><br/></td></tr>
<tr class="separator:a7ad6290493086138a1d40a5d79cfed17"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af7c8a584138805cdd58fc268fc8125a8"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#af7c8a584138805cdd58fc268fc8125a8">SignalAlarmException</a></td></tr>
<tr class="memdesc:af7c8a584138805cdd58fc268fc8125a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown when a time limit has elapsed.  <a href="#af7c8a584138805cdd58fc268fc8125a8">More...</a><br/></td></tr>
<tr class="separator:af7c8a584138805cdd58fc268fc8125a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa9705f1bf72752040cb1faefd741af75"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#aa9705f1bf72752040cb1faefd741af75">SignalChildException</a></td></tr>
<tr class="memdesc:aa9705f1bf72752040cb1faefd741af75"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown when a child process terminates.  <a href="#aa9705f1bf72752040cb1faefd741af75">More...</a><br/></td></tr>
<tr class="separator:aa9705f1bf72752040cb1faefd741af75"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a14e2d961b990ea9b03bc867c7c7236df"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a14e2d961b990ea9b03bc867c7c7236df">SignalTrapException</a></td></tr>
<tr class="memdesc:a14e2d961b990ea9b03bc867c7c7236df"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown when a condition arises that a debugger has requested to be informed of.  <a href="#a14e2d961b990ea9b03bc867c7c7236df">More...</a><br/></td></tr>
<tr class="separator:a14e2d961b990ea9b03bc867c7c7236df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab7b4334cedd9dd92aa16f583dabd94d0"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#ab7b4334cedd9dd92aa16f583dabd94d0">ErrorSignalException</a></td></tr>
<tr class="memdesc:ab7b4334cedd9dd92aa16f583dabd94d0"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is the common supertype of all error signal exceptions.  <a href="#ab7b4334cedd9dd92aa16f583dabd94d0">More...</a><br/></td></tr>
<tr class="separator:ab7b4334cedd9dd92aa16f583dabd94d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1f8767c09f8776465bab2fbf17e178dd"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a1f8767c09f8776465bab2fbf17e178dd">IllegalInstructionException</a></td></tr>
<tr class="memdesc:a1f8767c09f8776465bab2fbf17e178dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown when the process attempts to execute an illegal instruction.  <a href="#a1f8767c09f8776465bab2fbf17e178dd">More...</a><br/></td></tr>
<tr class="separator:a1f8767c09f8776465bab2fbf17e178dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6fcf200100e1cfde147d444aefe5cdb5"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a6fcf200100e1cfde147d444aefe5cdb5">ArithmeticException</a></td></tr>
<tr class="memdesc:a6fcf200100e1cfde147d444aefe5cdb5"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown when the process performs an erroneous arithmetic operation.  <a href="#a6fcf200100e1cfde147d444aefe5cdb5">More...</a><br/></td></tr>
<tr class="separator:a6fcf200100e1cfde147d444aefe5cdb5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a14d711083b9740a7188cbe9f2f915d4f"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a14d711083b9740a7188cbe9f2f915d4f">BrokenPipeException</a></td></tr>
<tr class="memdesc:a14d711083b9740a7188cbe9f2f915d4f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown when the process attempts to write to a broken pipe.  <a href="#a14d711083b9740a7188cbe9f2f915d4f">More...</a><br/></td></tr>
<tr class="separator:a14d711083b9740a7188cbe9f2f915d4f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aae2c0f060628a75c117ff4bf75f2804f"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#aae2c0f060628a75c117ff4bf75f2804f">BadPointerException</a></td></tr>
<tr class="memdesc:aae2c0f060628a75c117ff4bf75f2804f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown when the process tries to dereference an invalid pointer.  <a href="#aae2c0f060628a75c117ff4bf75f2804f">More...</a><br/></td></tr>
<tr class="separator:aae2c0f060628a75c117ff4bf75f2804f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae3f89b7484efca7715d70a781d2856a8"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#ae3f89b7484efca7715d70a781d2856a8">NullPointerException</a></td></tr>
<tr class="memdesc:ae3f89b7484efca7715d70a781d2856a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown when an unexpected null pointer is found.  <a href="#ae3f89b7484efca7715d70a781d2856a8">More...</a><br/></td></tr>
<tr class="separator:ae3f89b7484efca7715d70a781d2856a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a68c1b7bb934db83c6b996a535b5dbc95"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a68c1b7bb934db83c6b996a535b5dbc95">ControlSignalException</a></td></tr>
<tr class="memdesc:a68c1b7bb934db83c6b996a535b5dbc95"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is the common supertype of all control signal exceptions.  <a href="#a68c1b7bb934db83c6b996a535b5dbc95">More...</a><br/></td></tr>
<tr class="separator:a68c1b7bb934db83c6b996a535b5dbc95"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a94f5ec0761d8c1dc9a8d2355f1348570"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a94f5ec0761d8c1dc9a8d2355f1348570">StopException</a></td></tr>
<tr class="memdesc:a94f5ec0761d8c1dc9a8d2355f1348570"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown to stop the process for later resumption.  <a href="#a94f5ec0761d8c1dc9a8d2355f1348570">More...</a><br/></td></tr>
<tr class="separator:a94f5ec0761d8c1dc9a8d2355f1348570"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6af0a9ec525ab5af8a4442a79dcaca70"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a6af0a9ec525ab5af8a4442a79dcaca70">KillException</a></td></tr>
<tr class="memdesc:a6af0a9ec525ab5af8a4442a79dcaca70"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown to terminate the process immediately.  <a href="#a6af0a9ec525ab5af8a4442a79dcaca70">More...</a><br/></td></tr>
<tr class="separator:a6af0a9ec525ab5af8a4442a79dcaca70"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4766c592882555f4091cb9060f10ab5c"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a4766c592882555f4091cb9060f10ab5c">HangUpException</a></td></tr>
<tr class="memdesc:a4766c592882555f4091cb9060f10ab5c"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown when the process' terminal is closed.  <a href="#a4766c592882555f4091cb9060f10ab5c">More...</a><br/></td></tr>
<tr class="separator:a4766c592882555f4091cb9060f10ab5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a85b12608ec4e14046622ebcaf38b925e"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a85b12608ec4e14046622ebcaf38b925e">TerminationException</a></td></tr>
<tr class="memdesc:a85b12608ec4e14046622ebcaf38b925e"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown to request the termination of the process.  <a href="#a85b12608ec4e14046622ebcaf38b925e">More...</a><br/></td></tr>
<tr class="separator:a85b12608ec4e14046622ebcaf38b925e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa5e036c578fdf7577287f547cbc75234"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#aa5e036c578fdf7577287f547cbc75234">AbortException</a></td></tr>
<tr class="memdesc:aa5e036c578fdf7577287f547cbc75234"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown to abort the process.  <a href="#aa5e036c578fdf7577287f547cbc75234">More...</a><br/></td></tr>
<tr class="separator:aa5e036c578fdf7577287f547cbc75234"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51e3faa8033827a201cb162c52191a84"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a51e3faa8033827a201cb162c52191a84">CPUTimeException</a></td></tr>
<tr class="memdesc:a51e3faa8033827a201cb162c52191a84"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown when the process has used up the CPU for too long.  <a href="#a51e3faa8033827a201cb162c52191a84">More...</a><br/></td></tr>
<tr class="separator:a51e3faa8033827a201cb162c52191a84"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afe03611168e7eed8a894066663f3e41e"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#afe03611168e7eed8a894066663f3e41e">UserControlSignalException</a></td></tr>
<tr class="memdesc:afe03611168e7eed8a894066663f3e41e"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is the common supertype of all control signal exceptions caused by the user.  <a href="#afe03611168e7eed8a894066663f3e41e">More...</a><br/></td></tr>
<tr class="separator:afe03611168e7eed8a894066663f3e41e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a11a68cf0fcba3fb1a2dd7250d7ceed8c"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a11a68cf0fcba3fb1a2dd7250d7ceed8c">UserQuitException</a></td></tr>
<tr class="memdesc:a11a68cf0fcba3fb1a2dd7250d7ceed8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown when the user requests to quit the process.  <a href="#a11a68cf0fcba3fb1a2dd7250d7ceed8c">More...</a><br/></td></tr>
<tr class="separator:a11a68cf0fcba3fb1a2dd7250d7ceed8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ae85ae6281b40b4419ae8ac4cc6623b"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#a7ae85ae6281b40b4419ae8ac4cc6623b">UserInterruptionException</a></td></tr>
<tr class="memdesc:a7ae85ae6281b40b4419ae8ac4cc6623b"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown when the user requests to interrupt the process.  <a href="#a7ae85ae6281b40b4419ae8ac4cc6623b">More...</a><br/></td></tr>
<tr class="separator:a7ae85ae6281b40b4419ae8ac4cc6623b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac349a1072bfaf69546a8eee5ecd48974"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#ac349a1072bfaf69546a8eee5ecd48974">UserBreakException</a></td></tr>
<tr class="memdesc:ac349a1072bfaf69546a8eee5ecd48974"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown when a user wishes to break the process.  <a href="#ac349a1072bfaf69546a8eee5ecd48974">More...</a><br/></td></tr>
<tr class="separator:ac349a1072bfaf69546a8eee5ecd48974"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af41f0d1ad6046025d27c75003a453081"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#af41f0d1ad6046025d27c75003a453081">ProgramSignalException</a></td></tr>
<tr class="memdesc:af41f0d1ad6046025d27c75003a453081"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is the common supertype of all user-defined signal exceptions.  <a href="#af41f0d1ad6046025d27c75003a453081">More...</a><br/></td></tr>
<tr class="separator:af41f0d1ad6046025d27c75003a453081"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad99590ee7828c20bdd516ac0fb3cbd48"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#ad99590ee7828c20bdd516ac0fb3cbd48">ProgramSignal1Exception</a></td></tr>
<tr class="memdesc:ad99590ee7828c20bdd516ac0fb3cbd48"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown when user-defined conditions occur.  <a href="#ad99590ee7828c20bdd516ac0fb3cbd48">More...</a><br/></td></tr>
<tr class="separator:ad99590ee7828c20bdd516ac0fb3cbd48"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa262dd222a7bab5d046081ab04a39b17"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="e4c_8h.html#aa262dd222a7bab5d046081ab04a39b17">ProgramSignal2Exception</a></td></tr>
<tr class="memdesc:aa262dd222a7bab5d046081ab04a39b17"><td class="mdescLeft">&#160;</td><td class="mdescRight">This exception is thrown when user-defined conditions occur.  <a href="#aa262dd222a7bab5d046081ab04a39b17">More...</a><br/></td></tr>
<tr class="separator:aa262dd222a7bab5d046081ab04a39b17"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>exceptions4c header file </p>
<dl class="section version"><dt>Version</dt><dd>3.0 </dd></dl>
<dl class="section author"><dt>Author</dt><dd>Copyright (c) 2013 Guillermo Calvo</dd></dl>
<h1><a class="anchor" id="e4c_h"></a>
exceptions4c header file</h1>
<p>This header file needs to be included in order to be able to use any of the exception handling system keywords:</p>
<ul>
<li><code><a class="el" href="e4c_8h.html#a28599e8ac99ea9faff60a2258a914aee" title="Introduces a block of code aware of exceptions. ">try</a></code></li>
<li><code><a class="el" href="e4c_8h.html#a629585c5169ebdb440b9015f8e87b4df" title="Introduces a block of code capable of handling a specific type of exceptions. ">catch</a></code></li>
<li><code><a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a></code></li>
<li><code><a class="el" href="e4c_8h.html#a482d649fcaafd28584629da3606e4ea7" title="Signals an exceptional situation represented by an exception object. ">throw</a></code></li>
<li><code><a class="el" href="e4c_8h.html#a4afea611dbbe18fc3e3665166b3cd7bc" title="Opens a block of code with automatic disposal of a resource. ">with</a></code></li>
<li><code><a class="el" href="e4c_8h.html#abe1fc0d5310579fdfe7cca02506d06c2" title="Introduces a block of code with automatic acquisition and disposal of a resource. ...">using</a></code></li>
</ul>
<p>In order to stop defining these keywords, there exists a <code>E4C_NOKEYWORDS</code> <em>compile-time</em> parameter. When the keywords are not defined, the next set of alternative macros can be used to achieve the same functionality:</p>
<ul>
<li><code>E4C_TRY</code></li>
<li><code>E4C_CATCH</code></li>
<li><code>E4C_FINALLY</code></li>
<li><code>E4C_THROW</code></li>
<li><code>E4C_WITH</code></li>
<li><code>E4C_USING</code></li>
</ul>
<h1><a class="anchor" id="license"></a>
License</h1>
<blockquote class="doxtable">
<p>This is free software: you can redistribute it and/or modify it under the terms of the <b>GNU Lesser General Public License</b> as published by the <em>Free Software Foundation</em>, either version 3 of the License, or (at your option) any later version.</p>
<p>This software is distributed in the hope that it will be useful, but <b>WITHOUT ANY WARRANTY</b>; without even the implied warranty of <b>MERCHANTABILITY</b> or <b>FITNESS FOR A PARTICULAR PURPOSE</b>. See the <a href="http://www.gnu.org/licenses/lgpl.html">GNU Lesser General Public License</a> for more details.</p>
<p>You should have received a copy of the GNU Lesser General Public License along with this software. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>. </p>
</blockquote>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="acdcc5aaebf3f273c1762f24a6ece2e5e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define assert</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">condition)</td><td></td>
          <td>&#160;&#160;&#160;E4C_ASSERT(condition)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Expresses a program assertion. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">condition</td><td>A predicate that must evaluate to <code>true</code></td></tr>
  </table>
  </dd>
</dl>
<p>An assertion is a mechanism to express that the developer <em>thinks</em> that a specific condition is always met at some point of the program.</p>
<p><code>assert</code> is a convenient way to insert debugging assertions into a program. The <code>NDEBUG</code> <em>compile-time</em> parameter determines whether the assumptions will be actually verified by the program at <em>run-time</em>.</p>
<p>In presence of <code>NDEBUG</code>, the assertion statements will be ignored and therefore will have no effects on the program, not even evaluating the condition. Therefore expressions passed to <code>assert</code> <b>must not contain side-effects</b>, since they will not take place when debugging is disabled.</p>
<p>In absence of <code>NDEBUG</code>, the assertion statements will verify that the condition is met every time the program reaches that point of the program.</p>
<p>If the assertion does not hold at any time, then an <code><a class="el" href="e4c_8h.html#a64df4b96937a949466d55b5638c5b9cf" title="This exception is thrown when an assertion does not hold. ">AssertionException</a></code> will be thrown to indicate the programming error. This exception cannot be caught whatsoever. The program (or current thread) will be terminated.</p>
<p>The main advantage of using this assertion mechanism (as opposed to the macros provided by the standard header file <code>assert.h</code>) is that all of the pending <code><a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a></code> blocks will be executed, before actually exiting the program or thread.</p>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>A program (or thread) <b>must</b> begin an exception context prior to using the keyword <code>assert</code>. Such programming error will lead to an abrupt exit of the program (or thread).</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a64df4b96937a949466d55b5638c5b9cf" title="This exception is thrown when an assertion does not hold. ">AssertionException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a629585c5169ebdb440b9015f8e87b4df"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define catch</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">exception_type)</td><td></td>
          <td>&#160;&#160;&#160;E4C_CATCH(exception_type)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Introduces a block of code capable of handling a specific type of exceptions. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">exception_type</td><td>The type of exceptions to be handled</td></tr>
  </table>
  </dd>
</dl>
<p><code><a class="el" href="e4c_8h.html#a629585c5169ebdb440b9015f8e87b4df" title="Introduces a block of code capable of handling a specific type of exceptions. ">catch</a></code> blocks are optional code blocks that <b>must</b> be preceded by <code><a class="el" href="e4c_8h.html#a28599e8ac99ea9faff60a2258a914aee" title="Introduces a block of code aware of exceptions. ">try</a></code>, <code><a class="el" href="e4c_8h.html#a4afea611dbbe18fc3e3665166b3cd7bc" title="Opens a block of code with automatic disposal of a resource. ">with</a></code>... <code><a class="el" href="e4c_8h.html#aeda5446032a08fece73ec569b861a72c" title="Closes a block of code with automatic disposal of a resource. ">use</a></code> or <code><a class="el" href="e4c_8h.html#abe1fc0d5310579fdfe7cca02506d06c2" title="Introduces a block of code with automatic acquisition and disposal of a resource. ...">using</a></code> blocks. Several <code>catch</code> blocks can be placed next to one another.</p>
<p>When an exception is thrown, the system looks for a <code>catch</code> block to handle it. The first capable block (in order of appearance) will be executed. The exception is said to be <em>caught</em> and the <code>try</code> block is in <em>recovered</em> (status)[@ ref e4c_status].</p>
<p>The caught exception can be accessed through the function <a class="el" href="e4c_8h.html#ab67ff2dbcdda36ef766b096e7198614d" title="Returns the exception that was thrown. ">e4c_get_exception</a>.</p>
<div class="fragment"><div class="line"><span class="keywordflow">try</span>{</div>
<div class="line">    ...</div>
<div class="line">}<span class="keywordflow">catch</span>(RuntimeException){</div>
<div class="line">    <span class="keyword">const</span> <a class="code" href="structe4c__exception.html" title="Represents an instance of an exception type. ">e4c_exception</a> * exception = e4c_get_exception();</div>
<div class="line">    printf(<span class="stringliteral">&quot;Error: %s&quot;</span>, exception-&gt;<a class="code" href="structe4c__exception.html#ab92d64455df83a110d9fc2d17cf1d7bd" title="The message of this exception. ">message</a>);</div>
<div class="line">}</div>
</div><!-- fragment --><p>The actual type of the exception can be checked against other exception types through the function <a class="el" href="e4c_8h.html#a3f6c1f7c7b0765e1caea7fcda7641317" title="Returns whether an exception instance is of a given type. ">e4c_is_instance_of</a>.</p>
<div class="fragment"><div class="line"><span class="keywordflow">try</span>{</div>
<div class="line">    ...</div>
<div class="line">}<span class="keywordflow">catch</span>(RuntimeException){</div>
<div class="line">    <span class="keyword">const</span> <a class="code" href="structe4c__exception.html" title="Represents an instance of an exception type. ">e4c_exception</a> * exception = e4c_get_exception();</div>
<div class="line">    <span class="keywordflow">if</span>( e4c_is_instance_of(exception, &amp;SignalException) ){</div>
<div class="line">        <span class="comment">// the exception type is SignalException or any subtype</span></div>
<div class="line">    }</div>
<div class="line">}</div>
</div><!-- fragment --><p>The type might also be compared directly against another specific exception type.</p>
<div class="fragment"><div class="line"><span class="keywordflow">try</span>{</div>
<div class="line">    ...</div>
<div class="line">}<span class="keywordflow">catch</span>(RuntimeException){</div>
<div class="line">    <span class="keyword">const</span> <a class="code" href="structe4c__exception.html" title="Represents an instance of an exception type. ">e4c_exception</a> * exception = e4c_get_exception();</div>
<div class="line">    <span class="keywordflow">if</span>(exception-&gt;<a class="code" href="structe4c__exception.html#ad50162f7a5b6dd677286f5c31af79655" title="The type of this exception. ">type</a> == &amp;NotEnoughMemoryException){</div>
<div class="line">        <span class="comment">// the exception type is precisely NotEnoughMemoryException</span></div>
<div class="line">    }</div>
<div class="line">}</div>
</div><!-- fragment --><p>After the <code>catch</code> block completes, the <code><a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a></code> block (if any) is executed. Then the program continues by the next line following the set of <code>try</code>... <code>catch</code>... <code>finally</code> blocks.</p>
<p>However, if an exception is thrown in a <code>catch</code> block, then the <code>finally</code> block will be executed right away and the system will look for an outter <code>catch</code> block to handle it.</p>
<p>Only one of all the <code>catch</code> blocks will be executed for each <code>try</code> block, even though the executed <code>catch</code> block throws another exception. The only possible way to execute more than one <code>catch</code> block would be by <code><a class="el" href="e4c_8h.html#a0593b0774c47f8424effd591c2e93921" title="Repeats the previous try (or use) block entirely. ">retry</a></code>ing the entire <code>try</code> block.</p>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>A <code>catch</code> block <b>must</b> be preceded by one of these blocks:<ul>
<li>A <code>try</code> block</li>
<li>A <code>with</code>... <code><a class="el" href="e4c_8h.html#aeda5446032a08fece73ec569b861a72c" title="Closes a block of code with automatic disposal of a resource. ">use</a></code> block</li>
<li>A <code>using</code> block</li>
<li>Another <code>catch</code> block</li>
</ul>
</li>
<li>A <code>catch</code> block <b>must not</b> be exited through any of: <code>goto</code>, <code>break</code>, <code>continue</code> or <code>return</code> (but it is legal to <code><a class="el" href="e4c_8h.html#a482d649fcaafd28584629da3606e4ea7" title="Signals an exceptional situation represented by an exception object. ">throw</a></code> an exception).</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a28599e8ac99ea9faff60a2258a914aee" title="Introduces a block of code aware of exceptions. ">try</a> </dd>
<dd>
<a class="el" href="structe4c__exception__type.html" title="Represents an exception type in the exception handling system. ">e4c_exception_type</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#ab67ff2dbcdda36ef766b096e7198614d" title="Returns the exception that was thrown. ">e4c_get_exception</a> </dd>
<dd>
<a class="el" href="structe4c__exception.html" title="Represents an instance of an exception type. ">e4c_exception</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a3f6c1f7c7b0765e1caea7fcda7641317" title="Returns whether an exception instance is of a given type. ">e4c_is_instance_of</a> </dd></dl>

</div>
</div>
<a class="anchor" id="afbe55946f07a3dca22879ad5832b2a19"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define E4C_DECLARE_EXCEPTION</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">name)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">\</div>
<div class="line">    extern <span class="keyword">const</span> <a class="code" href="structe4c__exception__type.html" title="Represents an exception type in the exception handling system. ">e4c_exception_type</a> name</div>
</div><!-- fragment -->
<p>Declares an exception type. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>Name of the exception type</td></tr>
  </table>
  </dd>
</dl>
<p>This macro introduces the name of an <code>extern</code>, <code>const</code> <a class="el" href="structe4c__exception__type.html">exception type</a> which will be available to be thrown or caught:</p>
<div class="fragment"><div class="line"><a class="code" href="e4c_8h.html#afbe55946f07a3dca22879ad5832b2a19" title="Declares an exception type. ">E4C_DECLARE_EXCEPTION</a>(StackException);</div>
<div class="line"><a class="code" href="e4c_8h.html#afbe55946f07a3dca22879ad5832b2a19" title="Declares an exception type. ">E4C_DECLARE_EXCEPTION</a>(StackOverflowException);</div>
<div class="line"><a class="code" href="e4c_8h.html#afbe55946f07a3dca22879ad5832b2a19" title="Declares an exception type. ">E4C_DECLARE_EXCEPTION</a>(StackUnderflowException);</div>
</div><!-- fragment --><p>This macro is intended to be used inside header files.</p>
<dl class="section note"><dt>Note</dt><dd>When you <em>declare</em> exception types, no storage is allocated. In order to actually <em>define</em> them, you need to use the macro <code><a class="el" href="e4c_8h.html#aadc9f577bd369729df5aa614e54eedd8" title="Defines an exception type. ">E4C_DEFINE_EXCEPTION</a></code>.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="structe4c__exception__type.html" title="Represents an exception type in the exception handling system. ">e4c_exception_type</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#aadc9f577bd369729df5aa614e54eedd8" title="Defines an exception type. ">E4C_DEFINE_EXCEPTION</a> </dd></dl>

</div>
</div>
<a class="anchor" id="aadc9f577bd369729df5aa614e54eedd8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define E4C_DEFINE_EXCEPTION</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">name, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">default_message, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">supertype&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">\</div>
<div class="line">    const <a class="code" href="structe4c__exception__type.html" title="Represents an exception type in the exception handling system. ">e4c_exception_type</a> name = { \</div>
<div class="line"><span class="preprocessor">        #name, \</span></div>
<div class="line"><span class="preprocessor">        default_message, \</span></div>
<div class="line"><span class="preprocessor">        &amp;supertype \</span></div>
<div class="line"><span class="preprocessor">    }</span></div>
</div><!-- fragment -->
<p>Defines an exception type. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>Name of the new exception type </td></tr>
    <tr><td class="paramname">default_message</td><td>Default message of the new exception type </td></tr>
    <tr><td class="paramname">supertype</td><td>Supertype of the new exception type</td></tr>
  </table>
  </dd>
</dl>
<p>This macro allocates a new, <code>const</code> <a class="el" href="structe4c__exception__type.html">exception type</a>.</p>
<div class="fragment"><div class="line"><a class="code" href="e4c_8h.html#aadc9f577bd369729df5aa614e54eedd8" title="Defines an exception type. ">E4C_DEFINE_EXCEPTION</a>(StackException, <span class="stringliteral">&quot;Stack exception&quot;</span>, RuntimeException);</div>
<div class="line"><a class="code" href="e4c_8h.html#aadc9f577bd369729df5aa614e54eedd8" title="Defines an exception type. ">E4C_DEFINE_EXCEPTION</a>(StackOverflowException, <span class="stringliteral">&quot;Stack overflow&quot;</span>, StackException);</div>
<div class="line"><a class="code" href="e4c_8h.html#aadc9f577bd369729df5aa614e54eedd8" title="Defines an exception type. ">E4C_DEFINE_EXCEPTION</a>(StackUnderflowException, <span class="stringliteral">&quot;Stack underflow&quot;</span>, StackException);</div>
</div><!-- fragment --><p>This macro is intended to be used inside sorce code files. The defined exception types can be <em>declared</em> in a header file through the macro <code><a class="el" href="e4c_8h.html#afbe55946f07a3dca22879ad5832b2a19" title="Declares an exception type. ">E4C_DECLARE_EXCEPTION</a></code>.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="structe4c__exception__type.html" title="Represents an exception type in the exception handling system. ">e4c_exception_type</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a07da936a74602281d601c171b77bf0b0" title="This is the root of the exception pseudo-hierarchy ">RuntimeException</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#afbe55946f07a3dca22879ad5832b2a19" title="Declares an exception type. ">E4C_DECLARE_EXCEPTION</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a221e306037ef73b1788ddd261088230f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define E4C_EXCEPTION_MESSAGE_SIZE&#160;&#160;&#160;128</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Provides the maximum length (in bytes) of an exception message. </p>

</div>
</div>
<a class="anchor" id="acce379ab06acbdb14eb15e55cdba4631"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define E4C_IGNORE_SIGNAL</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">signal_number)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">\</div>
<div class="line">    {signal_number, NULL}</div>
</div><!-- fragment -->
<p>Ignores a specific signal number. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">signal_number</td><td>Numeric value of the signal to be ignored</td></tr>
  </table>
  </dd>
</dl>
<p>This macro represents a <a class="el" href="structe4c__signal__mapping.html">signal mapping</a> literal. It comes in handy for initializing arrays of signal mappings.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="structe4c__signal__mapping.html" title="Represents a map between a signal and an exception. ">e4c_signal_mapping</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a8a4c54a4d7cd10568b639749e8ec0e1f" title="Assigns the specified signal mappings to the exception context. ">e4c_context_set_signal_mappings</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a7290cbfb8abb0b2ecf338cdb4de5d6df" title="Retrieves the signal mappings for the current exception context. ">e4c_context_get_signal_mappings</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a598e01198e8ce022fdb32ae7145803f6" title="Maps a specific signal number to a given exception type. ">E4C_SIGNAL_MAPPING</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#ad9a799b298c1f39c427364bfc7bfb230" title="Represents a null signal mapping literal. ">E4C_NULL_SIGNAL_MAPPING</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#afbe55946f07a3dca22879ad5832b2a19" title="Declares an exception type. ">E4C_DECLARE_EXCEPTION</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a45c8b2837d07a0316df144169b6d57e5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define E4C_NO_RETURN</td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">\</div>
<div class="line">    E4C_NO_RETURN_</div>
</div><!-- fragment -->
<p>Marks a function which never returns. </p>
<p>This macro helps both developer and compiler to assume that the marked function will not return the control to its caller (unless by throwing an exception).</p>
<dl class="section note"><dt>Note</dt><dd>It does not make sense for these functions to have a return type other than <code>void</code>.</dd></dl>
<p>For example, a function <code>f1</code> that <b>always</b> throws an exception, could be marked with this macro:</p>
<div class="fragment"><div class="line"><span class="keywordtype">void</span> f1(<span class="keywordtype">int</span> foo) <a class="code" href="e4c_8h.html#a45c8b2837d07a0316df144169b6d57e5" title="Marks a function which never returns. ">E4C_NO_RETURN</a>;</div>
<div class="line"><span class="comment">// ...</span></div>
<div class="line"><span class="keywordtype">void</span> f1(<span class="keywordtype">int</span> foo){</div>
<div class="line">    <span class="keywordflow">if</span>(foo == 1){</div>
<div class="line">        <span class="keywordflow">throw</span>(MyException1, <span class="stringliteral">&quot;foo is one.&quot;</span>);</div>
<div class="line">    }</div>
<div class="line">    <span class="keywordflow">throw</span>(MyException2, <span class="stringliteral">&quot;foo is not one.&quot;</span>);</div>
<div class="line">}</div>
</div><!-- fragment --><p>Then, if another function tested a condition and then called <code>f1</code>, it wouldn't need to return anything witnin the <code>if</code> branch, nor consider the <code>else</code> branch of the test:</p>
<div class="fragment"><div class="line"><span class="keywordtype">int</span> f2(<span class="keywordtype">int</span> bar, <span class="keywordtype">int</span> foo){</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span>(bar == 0){</div>
<div class="line">        f1(foo);</div>
<div class="line">        <span class="comment">// return(-1);</span></div>
<div class="line">    }<span class="comment">// else</span></div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">return</span>(123);</div>
<div class="line"></div>
<div class="line">}</div>
</div><!-- fragment --><p>If the compiler supports this macro, it could optimize the program and avoid spurious warnings of uninitialized variables.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a38c22cb71d38cabd98aa850d4075e246" title="Simulates a function return. ">E4C_UNREACHABLE_RETURN</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ad9a799b298c1f39c427364bfc7bfb230"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define E4C_NULL_SIGNAL_MAPPING</td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">\</div>
<div class="line">    {E4C_INVALID_SIGNAL_NUMBER_, NULL}</div>
</div><!-- fragment -->
<p>Represents a null signal mapping literal. </p>
<p>This macro represents a <em>null</em> <a class="el" href="structe4c__signal__mapping.html">signal mapping</a> literal. It comes in handy for terminating arrays of <code><a class="el" href="structe4c__signal__mapping.html" title="Represents a map between a signal and an exception. ">e4c_signal_mapping</a></code>.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="structe4c__signal__mapping.html" title="Represents a map between a signal and an exception. ">e4c_signal_mapping</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a8a4c54a4d7cd10568b639749e8ec0e1f" title="Assigns the specified signal mappings to the exception context. ">e4c_context_set_signal_mappings</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a7290cbfb8abb0b2ecf338cdb4de5d6df" title="Retrieves the signal mappings for the current exception context. ">e4c_context_get_signal_mappings</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a598e01198e8ce022fdb32ae7145803f6" title="Maps a specific signal number to a given exception type. ">E4C_SIGNAL_MAPPING</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#acce379ab06acbdb14eb15e55cdba4631" title="Ignores a specific signal number. ">E4C_IGNORE_SIGNAL</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#afbe55946f07a3dca22879ad5832b2a19" title="Declares an exception type. ">E4C_DECLARE_EXCEPTION</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ae6ab0e5438f844f59155fee0ee92866f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define E4C_ON_FAILURE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">handler)</td><td></td>
          <td>&#160;&#160;&#160;handler( <a class="el" href="e4c_8h.html#ab67ff2dbcdda36ef766b096e7198614d">e4c_get_exception</a>() )</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Provides a means of parsing an exception to obtain a status value. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handler</td><td>The name of the parser function to be called</td></tr>
  </table>
  </dd>
</dl>
<p>This is a handy way to call a function when a <a class="el" href="e4c_8h.html#a67bf2b56660b4ddba6a66f7a54c4befd" title="Reuses an existing exception context, otherwise, begins a new one and then ends it. ">e4c_reusing_context</a> block fails. This function will be passed the current thrown exception; it is expected to parse it and return a proper <code>status</code> value.</p>
<div class="fragment"><div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> parse_exception(<span class="keyword">const</span> <a class="code" href="structe4c__exception.html" title="Represents an instance of an exception type. ">e4c_exception</a> * exception){</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span>(exception-&gt;<a class="code" href="structe4c__exception.html#ad50162f7a5b6dd677286f5c31af79655" title="The type of this exception. ">type</a> == &amp;NotEnoughMemoryException){</div>
<div class="line">        <span class="keywordflow">return</span>(STATUS_MEMORY_ERROR);</div>
<div class="line">    }<span class="keywordflow">else</span> <span class="keywordflow">if</span>( is_instance_of(exception, &amp;MyException) ){</div>
<div class="line">        <span class="keywordflow">return</span>(STATUS_MY_ERROR);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">return</span>(STATUS_ERROR);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> library_public_function(<span class="keywordtype">void</span> * pointer, <span class="keywordtype">int</span> number){</div>
<div class="line"></div>
<div class="line">    <span class="keyword">volatile</span> <span class="keywordtype">int</span> status = STATUS_OK;</div>
<div class="line"></div>
<div class="line">    <a class="code" href="e4c_8h.html#a67bf2b56660b4ddba6a66f7a54c4befd" title="Reuses an existing exception context, otherwise, begins a new one and then ends it. ">e4c_reusing_context</a>(status, <a class="code" href="e4c_8h.html#ae6ab0e5438f844f59155fee0ee92866f" title="Provides a means of parsing an exception to obtain a status value. ">E4C_ON_FAILURE</a>(parse_exception)){</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">if</span>(pointer == NULL){</div>
<div class="line">            <span class="keywordflow">throw</span>(NullPointerException);</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        library_private_function(pointer, number);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">return</span>(status);</div>
<div class="line">}</div>
</div><!-- fragment --><dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a67bf2b56660b4ddba6a66f7a54c4befd" title="Reuses an existing exception context, otherwise, begins a new one and then ends it. ">e4c_reusing_context</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#ab67ff2dbcdda36ef766b096e7198614d" title="Returns the exception that was thrown. ">e4c_get_exception</a> </dd>
<dd>
<a class="el" href="structe4c__exception.html" title="Represents an instance of an exception type. ">e4c_exception</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a67bf2b56660b4ddba6a66f7a54c4befd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define e4c_reusing_context</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">status, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">on_failure&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;E4C_REUSING_CONTEXT(status, on_failure)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reuses an existing exception context, otherwise, begins a new one and then ends it. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">status</td><td>The name of a previously defined variable, or lvalue, which will be assigned the specified failure value </td></tr>
    <tr><td class="paramname">on_failure</td><td>A constant value or expression that will be assigned to the specified <em>lvalue</em> in case of failure</td></tr>
  </table>
  </dd>
</dl>
<p>This macro lets library developers use the exception framework, regardless of whether the library clients are unaware of the exception handling system. In a nutshell, function libraries can use <code><a class="el" href="e4c_8h.html#a28599e8ac99ea9faff60a2258a914aee" title="Introduces a block of code aware of exceptions. ">try</a></code>, <code><a class="el" href="e4c_8h.html#a629585c5169ebdb440b9015f8e87b4df" title="Introduces a block of code capable of handling a specific type of exceptions. ">catch</a></code>, <code><a class="el" href="e4c_8h.html#a482d649fcaafd28584629da3606e4ea7" title="Signals an exceptional situation represented by an exception object. ">throw</a></code>, etc. whether the client previously began an exception context or not.</p>
<p>You <b>must not</b> use this macro unless you are implementing some functionality which is to be called from another program, potentially unaware of exceptions.</p>
<p>When the block completes, the system returns to its previous status (if it was required to open a new exception context, then it will be automatically closed).</p>
<p>This way, when an external function encounters an error, it may either throw an exception (when the caller is aware of the exception system), or otherwise return an error code (when the caller did not open an exception context).</p>
<p><code>e4c_reusing_context</code> takes two parameters:</p>
<ul>
<li><code>status</code> (<em>lvalue</em>)</li>
<li><code>on_failure</code> (<em>rvalue</em>)</li>
</ul>
<p><code>status</code> <b>must</b> will be assigned <code>on_failure</code> <b>if, and only if</b>, an exception is thrown inside the block. Needless to say, <code>on_failure</code> may be an expression assignable to <code>status</code>.</p>
<div class="fragment"><div class="line"><span class="keywordtype">int</span> library_public_function(<span class="keywordtype">void</span> * pointer, <span class="keywordtype">int</span> number){</div>
<div class="line"></div>
<div class="line">    <span class="comment">// We don&#39;t know where this function is going to be called from, so:</span></div>
<div class="line">    <span class="comment">//   - We cannot use &quot;try&quot;, &quot;throw&quot;, etc. right here, because the</span></div>
<div class="line">    <span class="comment">//     exception context COULD be uninitialized at this very moment.</span></div>
<div class="line">    <span class="comment">//   - We cannot call &quot;e4c_context_begin&quot; either, because the</span></div>
<div class="line">    <span class="comment">//     exception context COULD be already initialized.</span></div>
<div class="line">    <span class="comment">// If we have to make use of the exception handling system, we need</span></div>
<div class="line">    <span class="comment">// to &quot;reuse&quot; the existing exception context or &quot;use&quot; a new one.</span></div>
<div class="line"></div>
<div class="line">    <span class="keyword">volatile</span> <span class="keywordtype">int</span> status = STATUS_OK;</div>
<div class="line"></div>
<div class="line">    <a class="code" href="e4c_8h.html#a67bf2b56660b4ddba6a66f7a54c4befd" title="Reuses an existing exception context, otherwise, begins a new one and then ends it. ">e4c_reusing_context</a>(status, STATUS_ERROR){</div>
<div class="line"></div>
<div class="line">        <span class="comment">// Now we can safely use &quot;try&quot;, &quot;throw&quot;, etc.</span></div>
<div class="line">        <span class="keywordflow">if</span>(pointer == NULL){</div>
<div class="line">            <span class="keywordflow">throw</span>(NullPointerException);</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        library_private_function(pointer, number);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">return</span>(status);</div>
<div class="line">}</div>
</div><!-- fragment --><p><code>status</code> will be left unmodified if the client (i.e. the function caller) is <em>exception-aware</em>, or the block <em>completes</em> without an error (i.e. no exception is thrown), so it <b>must</b> be properly initialized before returning it.</p>
<p>Please note that <code>status</code> doesn't have to be just a dichotomy (success or failure). It can be a fine-grained value describing what exactly went wrong. You can pass any expression to <code>e4c_reusing_context</code> as <code>on_failure</code>; it will be evaluated when an exception is thrown:</p>
<div class="fragment"><div class="line"><span class="keywordtype">int</span> library_public_function(<span class="keywordtype">void</span> * pointer, <span class="keywordtype">int</span> number){</div>
<div class="line"></div>
<div class="line">    <span class="keyword">volatile</span> <span class="keywordtype">int</span> status = STATUS_OK;</div>
<div class="line">    <span class="keyword">volatile</span> <span class="keywordtype">bool</span> flag = <span class="keyword">true</span>;</div>
<div class="line"></div>
<div class="line">    <a class="code" href="e4c_8h.html#a67bf2b56660b4ddba6a66f7a54c4befd" title="Reuses an existing exception context, otherwise, begins a new one and then ends it. ">e4c_reusing_context</a>(status,(flag?STATUS_NULL_POINTER:STATUS_ERROR)){</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">if</span>(pointer == NULL){</div>
<div class="line">            <span class="keywordflow">throw</span>(NullPointerException);</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        flag = <span class="keyword">false</span>;</div>
<div class="line"></div>
<div class="line">        library_private_function(pointer, number);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">return</span>(status);</div>
<div class="line">}</div>
</div><!-- fragment --><p>However, Most of the times you probably want to yield a different status value depending on the specific exception being thrown. This can be easily accomplished by making use of the macro <code><a class="el" href="e4c_8h.html#ae6ab0e5438f844f59155fee0ee92866f" title="Provides a means of parsing an exception to obtain a status value. ">E4C_ON_FAILURE</a></code>.</p>
<p>Next, the semantics of <code>e4c_reusing_context</code> are explained, step by step:</p>
<ul>
<li>If there is an exception context at the time the block starts:<ol type="1">
<li>The existing exception context will be reused.</li>
<li>The code block will take place.</li>
<li>If any exception is thrown during the execution of the block:<ul>
<li>It will be <b>propagated</b> upwards to the caller.</li>
<li>The control will be transferred to the nearest surrounding block of code which is able to handle that exception.</li>
</ul>
</li>
</ol>
</li>
<li>If there is no exception context at the time the block starts:<ol type="1">
<li>A new exception context will be begun; note that the signal handling system <b>WILL NOT</b> be set up.</li>
<li>The code block will take place.</li>
<li>If any exception is thrown during the execution of the block:<ul>
<li>It will be <b>caught</b>.</li>
<li><code>status</code> will be asigned the value of the expression <code>on_failure</code>.</li>
</ul>
</li>
</ol>
</li>
</ul>
<p>If you need to perform any cleanup, you should place it <em>inside</em> a <code><a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a></code> block.</p>
<div class="fragment"><div class="line">...</div>
<div class="line">e4c_reusing_context(status, STATUS_ERROR){</div>
<div class="line"></div>
<div class="line">    <span class="keywordtype">void</span> * buffer = NULL;</div>
<div class="line">    <span class="keywordflow">try</span>{</div>
<div class="line">        buffer = malloc(1024);</div>
<div class="line">        ...</div>
<div class="line">    }<span class="keywordflow">finally</span>{</div>
<div class="line">        free(buffer);</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line">...</div>
</div><!-- fragment --><p>If you need to rely on the signal handling system, you may call <code><a class="el" href="e4c_8h.html#a8a4c54a4d7cd10568b639749e8ec0e1f" title="Assigns the specified signal mappings to the exception context. ">e4c_context_set_signal_mappings</a></code> explicitly. You should take into account that you could be <em>hijacking</em> your client's original signal mappings, so you should also call <code><a class="el" href="e4c_8h.html#a7290cbfb8abb0b2ecf338cdb4de5d6df" title="Retrieves the signal mappings for the current exception context. ">e4c_context_get_signal_mappings</a></code> in order to restore the previous signal mappings when you are done.</p>
<div class="fragment"><div class="line"><span class="keyword">const</span> <a class="code" href="structe4c__signal__mapping.html" title="Represents a map between a signal and an exception. ">e4c_signal_mapping</a> new_mappings[] = {</div>
<div class="line">    <a class="code" href="e4c_8h.html#a598e01198e8ce022fdb32ae7145803f6" title="Maps a specific signal number to a given exception type. ">E4C_SIGNAL_MAPPING</a>(SIGABRT, Exception1),</div>
<div class="line">    <a class="code" href="e4c_8h.html#a598e01198e8ce022fdb32ae7145803f6" title="Maps a specific signal number to a given exception type. ">E4C_SIGNAL_MAPPING</a>(SIGINT, Exception2),</div>
<div class="line">    <a class="code" href="e4c_8h.html#acce379ab06acbdb14eb15e55cdba4631" title="Ignores a specific signal number. ">E4C_IGNORE_SIGNAL</a>(SIGTERM),</div>
<div class="line">    ...</div>
<div class="line">    <a class="code" href="e4c_8h.html#ad9a799b298c1f39c427364bfc7bfb230" title="Represents a null signal mapping literal. ">E4C_NULL_SIGNAL_MAPPING</a></div>
<div class="line">};</div>
<div class="line">...</div>
<div class="line">e4c_reusing_context(status, STATUS_ERROR){</div>
<div class="line"></div>
<div class="line">    <span class="keyword">const</span> <a class="code" href="structe4c__signal__mapping.html" title="Represents a map between a signal and an exception. ">e4c_signal_mapping</a> * old_mappings = e4c_context_get_signal_mappings();</div>
<div class="line"></div>
<div class="line">    e4c_context_set_signal_mappings(new_mappings);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">try</span>{</div>
<div class="line">        ...</div>
<div class="line">    }<span class="keywordflow">finally</span>{</div>
<div class="line">        e4c_context_set_signal_mappings(old_mappings);</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line">...</div>
</div><!-- fragment --><p>This macro only begins a new exception context <b>if there is no one, already begun, to be used</b> whereas <code><a class="el" href="e4c_8h.html#a27678c11fa7d4e2a9436f527cc194013" title="Introduces a block of code which will use a new exception context. ">e4c_using_context</a></code> always attempts to begin a new one.</p>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>A block introduced by <code>e4c_reusing_context</code> <b>must not</b> be exited through any of: <code>goto</code>, <code>break</code>, <code>continue</code> or <code>return</code> (but it is legal to <code><a class="el" href="e4c_8h.html#a482d649fcaafd28584629da3606e4ea7" title="Signals an exceptional situation represented by an exception object. ">throw</a></code> an exception). </li>
</ul>
</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd><ul>
<li>A block introduced by <code>e4c_reusing_context</code> is guaranteed to take place <em>inside</em> an exception context.</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a1e27be2186952ed77b4591f48c5d11cd" title="Begins an exception context. ">e4c_context_begin</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a7fbe6fb51b19a6485f806c006711ec74" title="Ends the current exception context. ">e4c_context_end</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a64b5cdb24278ff07e6f7767b68890473" title="Checks if the current exception context is ready. ">e4c_context_is_ready</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a27678c11fa7d4e2a9436f527cc194013" title="Introduces a block of code which will use a new exception context. ">e4c_using_context</a> </dd>
<dd>
<a class="el" href="structe4c__exception.html" title="Represents an instance of an exception type. ">e4c_exception</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#ae6ab0e5438f844f59155fee0ee92866f" title="Provides a means of parsing an exception to obtain a status value. ">E4C_ON_FAILURE</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a598e01198e8ce022fdb32ae7145803f6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define E4C_SIGNAL_MAPPING</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">signal_number, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">exception_type&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">\</div>
<div class="line">    {signal_number, &amp;exception_type}</div>
</div><!-- fragment -->
<p>Maps a specific signal number to a given exception type. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">signal_number</td><td>Numeric value of the signal to be converted </td></tr>
    <tr><td class="paramname">exception_type</td><td>Exception type representing the signal</td></tr>
  </table>
  </dd>
</dl>
<p>This macro represents a <a class="el" href="structe4c__signal__mapping.html">signal mapping</a> literal. It comes in handy for initializing arrays of signal mappings.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="structe4c__signal__mapping.html" title="Represents a map between a signal and an exception. ">e4c_signal_mapping</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a8a4c54a4d7cd10568b639749e8ec0e1f" title="Assigns the specified signal mappings to the exception context. ">e4c_context_set_signal_mappings</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a7290cbfb8abb0b2ecf338cdb4de5d6df" title="Retrieves the signal mappings for the current exception context. ">e4c_context_get_signal_mappings</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#acce379ab06acbdb14eb15e55cdba4631" title="Ignores a specific signal number. ">E4C_IGNORE_SIGNAL</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#ad9a799b298c1f39c427364bfc7bfb230" title="Represents a null signal mapping literal. ">E4C_NULL_SIGNAL_MAPPING</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#afbe55946f07a3dca22879ad5832b2a19" title="Declares an exception type. ">E4C_DECLARE_EXCEPTION</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a38c22cb71d38cabd98aa850d4075e246"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define E4C_UNREACHABLE_RETURN</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">value)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">\</div>
<div class="line">    E4C_UNREACHABLE_RETURN_(value)</div>
</div><!-- fragment -->
<p>Simulates a function return. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>The value that would be returned if the statement took place.</td></tr>
  </table>
  </dd>
</dl>
<p>This macro ensures portability on compilers which don't support functions that never return.</p>
<p>It may be used after calling a function marked as <code><a class="el" href="e4c_8h.html#a45c8b2837d07a0316df144169b6d57e5" title="Marks a function which never returns. ">E4C_NO_RETURN</a></code>, so that the compiler will not complain about <em>control reaching end of non-void function</em>. For example:</p>
<div class="fragment"><div class="line"><span class="keywordtype">void</span> f1(<span class="keywordtype">int</span> foo) <a class="code" href="e4c_8h.html#a45c8b2837d07a0316df144169b6d57e5" title="Marks a function which never returns. ">E4C_NO_RETURN</a>;</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> f3(<span class="keywordtype">int</span> bar, <span class="keywordtype">int</span> foo){</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span>(bar != 0){</div>
<div class="line">        <span class="keywordflow">return</span>(123);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    f1(123);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="e4c_8h.html#a38c22cb71d38cabd98aa850d4075e246" title="Simulates a function return. ">E4C_UNREACHABLE_RETURN</a>(-1);</div>
<div class="line">}</div>
</div><!-- fragment --><p>This macro will become an actual <code>return</code> statement if the compiler does not support <code>E4C_NO_RETURN</code>, even though it will never be reached (because the called function won't actually return control).</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a45c8b2837d07a0316df144169b6d57e5" title="Marks a function which never returns. ">E4C_NO_RETURN</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#adc10e326f26beef709f69e2495d390f2" title="Simulates a function void return. ">E4C_UNREACHABLE_VOID_RETURN</a> </dd></dl>

</div>
</div>
<a class="anchor" id="adc10e326f26beef709f69e2495d390f2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define E4C_UNREACHABLE_VOID_RETURN</td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">\</div>
<div class="line">    E4C_UNREACHABLE_VOID_RETURN_</div>
</div><!-- fragment -->
<p>Simulates a function void return. </p>
<p>This macro ensures portability on static source code analyzers which don't support functions that never return.</p>
<p>It may be used after calling a function marked as <code><a class="el" href="e4c_8h.html#a45c8b2837d07a0316df144169b6d57e5" title="Marks a function which never returns. ">E4C_NO_RETURN</a></code>, so that the analyzer will not complain about spurious errors. For example, if we didn't use <code>E4C_UNREACHABLE_VOID_RETURN</code> here, some analyzers might complain about <em>possible null pointer dereference</em> at line <code>foo = *bar</code>, because they are not aware that function call <code>f1(321);</code> will never return control:</p>
<div class="fragment"><div class="line"><span class="keywordtype">void</span> f1(<span class="keywordtype">int</span> foo) <a class="code" href="e4c_8h.html#a45c8b2837d07a0316df144169b6d57e5" title="Marks a function which never returns. ">E4C_NO_RETURN</a>;</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> f3(<span class="keywordtype">int</span> * bar){</div>
<div class="line"></div>
<div class="line">    <span class="keywordtype">int</span> foo;</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span>(bar == NULL){</div>
<div class="line">        f1(321);</div>
<div class="line">        <a class="code" href="e4c_8h.html#adc10e326f26beef709f69e2495d390f2" title="Simulates a function void return. ">E4C_UNREACHABLE_VOID_RETURN</a>;</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    foo = *bar;</div>
<div class="line">    printf(<span class="stringliteral">&quot;value: %d&quot;</span>, foo);</div>
<div class="line">}</div>
</div><!-- fragment --><p>This macro will become an actual <code>return</code> statement if the compiler does not support <code>E4C_NO_RETURN</code>, even though it will never be reached (because the called function won't actually return control).</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a45c8b2837d07a0316df144169b6d57e5" title="Marks a function which never returns. ">E4C_NO_RETURN</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a38c22cb71d38cabd98aa850d4075e246" title="Simulates a function return. ">E4C_UNREACHABLE_RETURN</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a27678c11fa7d4e2a9436f527cc194013"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define e4c_using_context</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">handle_signals)</td><td></td>
          <td>&#160;&#160;&#160;E4C_USING_CONTEXT(handle_signals)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Introduces a block of code which will use a new exception context. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle_signals</td><td>If <code>true</code>, the signal handling system will be set up with the default mapping.</td></tr>
  </table>
  </dd>
</dl>
<p>This macro begins a new exception context to be used by the code block right next to it. When the code completes, <code><a class="el" href="e4c_8h.html#a7fbe6fb51b19a6485f806c006711ec74" title="Ends the current exception context. ">e4c_context_end</a></code> will be called implicitly.</p>
<p>This macro is very convenient when the beginning and the ending of the current exception context are next to each other. For example, there is no semantic difference between this two blocks of code:</p>
<div class="fragment"><div class="line"><span class="comment">// block 1</span></div>
<div class="line">e4c_context_begin(E4C_TRUE);</div>
<div class="line"><span class="comment">// ...</span></div>
<div class="line">e4c_context_end();</div>
<div class="line"></div>
<div class="line"><span class="comment">// block 2</span></div>
<div class="line"><a class="code" href="e4c_8h.html#a27678c11fa7d4e2a9436f527cc194013" title="Introduces a block of code which will use a new exception context. ">e4c_using_context</a>(E4C_TRUE){</div>
<div class="line">    <span class="comment">// ...</span></div>
<div class="line">}</div>
</div><!-- fragment --><p>This macro <b>always</b> attempts to begin a new exception context, whereas <code><a class="el" href="e4c_8h.html#a67bf2b56660b4ddba6a66f7a54c4befd" title="Reuses an existing exception context, otherwise, begins a new one and then ends it. ">e4c_reusing_context</a></code> only does if there is no exception context, already begun, to be used.</p>
<p>This macro <b>should be used whenever possible</b>, rather than doing the explicit, manual calls to <code><a class="el" href="e4c_8h.html#a1e27be2186952ed77b4591f48c5d11cd" title="Begins an exception context. ">e4c_context_begin</a></code> and <code><a class="el" href="e4c_8h.html#a7fbe6fb51b19a6485f806c006711ec74" title="Ends the current exception context. ">e4c_context_end</a></code>, because it is less prone to errors.</p>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>A block introduced by <code>e4c_using_context</code> <b>must not</b> be exited through any of: <code>goto</code>, <code>break</code>, <code>continue</code> or <code>return</code> (but it is legal to <code><a class="el" href="e4c_8h.html#a482d649fcaafd28584629da3606e4ea7" title="Signals an exceptional situation represented by an exception object. ">throw</a></code> an exception). </li>
</ul>
</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd><ul>
<li>A block introduced by <code><a class="el" href="e4c_8h.html#a27678c11fa7d4e2a9436f527cc194013" title="Introduces a block of code which will use a new exception context. ">e4c_using_context</a></code> is guaranteed to take place <em>inside</em> an exception context.</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a1e27be2186952ed77b4591f48c5d11cd" title="Begins an exception context. ">e4c_context_begin</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a7fbe6fb51b19a6485f806c006711ec74" title="Ends the current exception context. ">e4c_context_end</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a67bf2b56660b4ddba6a66f7a54c4befd" title="Reuses an existing exception context, otherwise, begins a new one and then ends it. ">e4c_reusing_context</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a890f79613092dcd580078ff46babfb6e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define E4C_VERSION_MAJOR</td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">\</div>
<div class="line">    E4C_VERSION_(E4C_VERSION_MAJOR_)</div>
</div><!-- fragment -->
<p>Provides the library major version number. </p>
<p>The library major version number is an <code>int</code> value which is incremented from one release to another when there are <b>significant changes in functionality</b>.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#aaabdc92526a7fb8e02558867f3ad0cb8" title="Provides the library version number. ">E4C_VERSION_NUMBER</a> </dd></dl>

</div>
</div>
<a class="anchor" id="aa4564247c8f8fa73e293f24e9790e2b5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define E4C_VERSION_MINOR</td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">\</div>
<div class="line">    E4C_VERSION_(E4C_VERSION_MINOR_)</div>
</div><!-- fragment -->
<p>Provides the library minor version number. </p>
<p>The library minor version number is an <code>int</code> value which is incremented from one release to another when <b>only minor features or significant fixes have been added</b>.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#aaabdc92526a7fb8e02558867f3ad0cb8" title="Provides the library version number. ">E4C_VERSION_NUMBER</a> </dd></dl>

</div>
</div>
<a class="anchor" id="aaabdc92526a7fb8e02558867f3ad0cb8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define E4C_VERSION_NUMBER</td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">\</div>
<div class="line">    E4C_VERSION_(E4C_VERSION_NUMBER_)</div>
</div><!-- fragment -->
<p>Provides the library version number. </p>
<p>The library version number is a <code>long</code> value which expresses:</p>
<ul>
<li>library thread mode (either <em>single-thread</em> or <em>multi-thread</em>)</li>
<li>library <em>major</em> version number</li>
<li>library <em>minor</em> version number</li>
<li>library <em>revision</em> number</li>
</ul>
<p>The multi-thread (or <em>thread-safe</em>) mode can be enabled by compiling the library with the <code>E4C_THREADSAFE</code> <em>compile-time</em> parameter.</p>
<p>The formula to encode these version numbers into a single <code>long</code> value is:</p>
<div class="fragment"><div class="line">THREADSAFE * 10000000 + MAJOR * 1000000 + MINOR * 1000 + REVISION</div>
</div><!-- fragment --><p>These numbers can be obtained separately through the next macros:</p>
<ul>
<li><code><a class="el" href="e4c_8h.html#a28f15bc301e1a0a004040d0f2c196139" title="Provides the library thread mode (either single-thread or multi-thread) ">E4C_VERSION_THREADSAFE</a></code></li>
<li><code><a class="el" href="e4c_8h.html#a890f79613092dcd580078ff46babfb6e" title="Provides the library major version number. ">E4C_VERSION_MAJOR</a></code></li>
<li><code><a class="el" href="e4c_8h.html#aa4564247c8f8fa73e293f24e9790e2b5" title="Provides the library minor version number. ">E4C_VERSION_MINOR</a></code></li>
<li><code><a class="el" href="e4c_8h.html#a472fdc2124dfc3fc50680cbf5811c868" title="Provides the library revision number. ">E4C_VERSION_REVISION</a></code></li>
</ul>
<p>The library version number can be also obtained as a string literal in the format "MAJOR.MINOR.REVISION (THREADSAFE)" through the macro <code><a class="el" href="e4c_8h.html#aea131104dcb566c9e4d134c476758b2c" title="Provides the library version number as a string literal. ">E4C_VERSION_STRING</a></code>.</p>
<dl class="section note"><dt>Note</dt><dd>This version number can be considered as the <em>compile-time</em> library version number, as opposed to the <em>run-time</em> library version number (associated with the actual, compiled library). This <em>run-time</em> version number can be obtained through the function <code><a class="el" href="e4c_8h.html#ac84af6b4e6798e3cc98de0012dcacb7f" title="Gets the library version number. ">e4c_library_version</a></code>.</dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd>The library <b>must</b> be compiled with the corresponding header (i.e. library version number should be equal to header version number).</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#ac84af6b4e6798e3cc98de0012dcacb7f" title="Gets the library version number. ">e4c_library_version</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a28f15bc301e1a0a004040d0f2c196139" title="Provides the library thread mode (either single-thread or multi-thread) ">E4C_VERSION_THREADSAFE</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a890f79613092dcd580078ff46babfb6e" title="Provides the library major version number. ">E4C_VERSION_MAJOR</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#aa4564247c8f8fa73e293f24e9790e2b5" title="Provides the library minor version number. ">E4C_VERSION_MINOR</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a472fdc2124dfc3fc50680cbf5811c868" title="Provides the library revision number. ">E4C_VERSION_REVISION</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#aea131104dcb566c9e4d134c476758b2c" title="Provides the library version number as a string literal. ">E4C_VERSION_STRING</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a472fdc2124dfc3fc50680cbf5811c868"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define E4C_VERSION_REVISION</td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">\</div>
<div class="line">    E4C_VERSION_(E4C_VERSION_REVISION_)</div>
</div><!-- fragment -->
<p>Provides the library revision number. </p>
<p>The library revision number is an <code>int</code> value which is incremented from one release to another when <b>minor bugs are fixed</b>.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#aaabdc92526a7fb8e02558867f3ad0cb8" title="Provides the library version number. ">E4C_VERSION_NUMBER</a> </dd></dl>

</div>
</div>
<a class="anchor" id="aea131104dcb566c9e4d134c476758b2c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define E4C_VERSION_STRING</td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">\</div>
<div class="line">    E4C_VERSION_(E4C_VERSION_STRING_)</div>
</div><!-- fragment -->
<p>Provides the library version number as a string literal. </p>
<p>The format of the string literal is: "MAJOR.MINOR.REVISION (THREADSAFE)".</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#aaabdc92526a7fb8e02558867f3ad0cb8" title="Provides the library version number. ">E4C_VERSION_NUMBER</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a28f15bc301e1a0a004040d0f2c196139"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define E4C_VERSION_THREADSAFE</td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">\</div>
<div class="line">    E4C_VERSION_THREADSAFE_</div>
</div><!-- fragment -->
<p>Provides the library thread mode (either single-thread or multi-thread) </p>
<p>When the library is compiled with the <code>E4C_THREADSAFE</code> <em>compile-time</em> parameter, <code><a class="el" href="e4c_8h.html#a28f15bc301e1a0a004040d0f2c196139" title="Provides the library thread mode (either single-thread or multi-thread) ">E4C_VERSION_THREADSAFE</a></code> will yield the <code>int</code> value <code>1</code> (meaning <em>multi-thread</em> mode), otherwise it will yield the <code>int</code> value <code>0</code> (meaning <em>single-thread</em> mode).</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#aaabdc92526a7fb8e02558867f3ad0cb8" title="Provides the library version number. ">E4C_VERSION_NUMBER</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a6f547472794c162cc629f53cd4db5454"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define finally&#160;&#160;&#160;E4C_FINALLY</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Introduces a block of code responsible for cleaning up the previous exception-aware block. </p>
<p><code><a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a></code> blocks are optional code blocks that <b>must</b> be preceded by <code><a class="el" href="e4c_8h.html#a28599e8ac99ea9faff60a2258a914aee" title="Introduces a block of code aware of exceptions. ">try</a></code>, <code><a class="el" href="e4c_8h.html#a4afea611dbbe18fc3e3665166b3cd7bc" title="Opens a block of code with automatic disposal of a resource. ">with</a></code>... <code><a class="el" href="e4c_8h.html#aeda5446032a08fece73ec569b861a72c" title="Closes a block of code with automatic disposal of a resource. ">use</a></code> or <code><a class="el" href="e4c_8h.html#abe1fc0d5310579fdfe7cca02506d06c2" title="Introduces a block of code with automatic acquisition and disposal of a resource. ...">using</a></code> blocks. It is allowed to place, at most, one <code>finally</code> block for each one of these.</p>
<p>The <code>finally</code> block can determine the completeness of the <em>exception-aware</em> block through the function <code><a class="el" href="e4c_8h.html#a961e9d117c98424796ae769f2b2e6b26" title="Returns the completeness status of the executing code block. ">e4c_get_status</a></code>. The thrown exception (if any) can also be accessed through the function <code><a class="el" href="e4c_8h.html#ab67ff2dbcdda36ef766b096e7198614d" title="Returns the exception that was thrown. ">e4c_get_exception</a></code>.</p>
<div class="fragment"><div class="line"><span class="keywordflow">try</span>{</div>
<div class="line">   ...</div>
<div class="line">}<span class="keywordflow">finally</span>{</div>
<div class="line">   <span class="keywordflow">switch</span>( e4c_get_status() ){</div>
<div class="line"></div>
<div class="line">       <span class="keywordflow">case</span> <a class="code" href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50ad78680d90dc3a7e42da9f2eb2ff8e4c9" title="There were no exceptions. ">e4c_succeeded</a>:</div>
<div class="line">           ...</div>
<div class="line">           <span class="keywordflow">break</span>;</div>
<div class="line"></div>
<div class="line">       <span class="keywordflow">case</span> <a class="code" href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50a8d27c3fe156c5e88b8927a45a99903c8" title="There was an exception, but it was caught. ">e4c_recovered</a>:</div>
<div class="line">           ...</div>
<div class="line">           <span class="keywordflow">break</span>;</div>
<div class="line"></div>
<div class="line">       <span class="keywordflow">case</span> <a class="code" href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50a3e25fc733de62745054a380444ada211" title="There was an exception and it wasn&#39;t caught. ">e4c_failed</a>:</div>
<div class="line">           ...</div>
<div class="line">           <span class="keywordflow">break</span>;</div>
<div class="line">   }</div>
<div class="line">}</div>
</div><!-- fragment --><p>The finally block will be executed only <b>once</b>. The only possible way to execute it again would be by <code><a class="el" href="e4c_8h.html#a0593b0774c47f8424effd591c2e93921" title="Repeats the previous try (or use) block entirely. ">retry</a></code>ing the entire <code>try</code> block.</p>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>A <code>finally</code> block <b>must</b> be preceded by a <code>try</code>, <code>with</code>... <code>use</code>, <code>using</code> or <code>catch</code> block.</li>
<li>A <code>finally</code> block <b>must not</b> be exited through any of: <code>goto</code>, <code>break</code>, <code>continue</code> or <code>return</code> (but it is legal to <code><a class="el" href="e4c_8h.html#a482d649fcaafd28584629da3606e4ea7" title="Signals an exceptional situation represented by an exception object. ">throw</a></code> an exception). </li>
</ul>
</dd>
<dd>
<ul>
<li>A program (or thread) <b>must</b> begin an exception context prior to using the keyword <code>finally</code>. Such programming error will lead to an abrupt exit of the program (or thread).</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="structe4c__exception.html" title="Represents an instance of an exception type. ">e4c_exception</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#ab67ff2dbcdda36ef766b096e7198614d" title="Returns the exception that was thrown. ">e4c_get_exception</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a961e9d117c98424796ae769f2b2e6b26" title="Returns the completeness status of the executing code block. ">e4c_get_status</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50" title="Represents the completeness of a code block aware of exceptions. ">e4c_status</a> </dd></dl>

</div>
</div>
<a class="anchor" id="aeb7a4b6d23a08c92e14ce6f496ae6050"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define reacquire</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">max_reacquire_attempts)</td><td></td>
          <td>&#160;&#160;&#160;E4C_REACQUIRE(max_reacquire_attempts)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Repeats the previous <code><a class="el" href="e4c_8h.html#a4afea611dbbe18fc3e3665166b3cd7bc" title="Opens a block of code with automatic disposal of a resource. ">with</a></code> block entirely. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">max_reacquire_attempts</td><td>The maximum number of attempts to reacquire</td></tr>
  </table>
  </dd>
</dl>
<p>This macro discards any thrown exception (if any) and repeats the previous <code>with</code> block, up to a specified maximum number of attempts. If the acquisition completes, then the <code>use</code> block will be executed.</p>
<p>It is intended to be used within <code><a class="el" href="e4c_8h.html#a629585c5169ebdb440b9015f8e87b4df" title="Introduces a block of code capable of handling a specific type of exceptions. ">catch</a></code> or <code><a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a></code> blocks, next to a <code><a class="el" href="e4c_8h.html#a4afea611dbbe18fc3e3665166b3cd7bc" title="Opens a block of code with automatic disposal of a resource. ">with</a></code>... <code><a class="el" href="e4c_8h.html#aeda5446032a08fece73ec569b861a72c" title="Closes a block of code with automatic disposal of a resource. ">use</a></code> or <code><a class="el" href="e4c_8h.html#abe1fc0d5310579fdfe7cca02506d06c2" title="Introduces a block of code with automatic acquisition and disposal of a resource. ...">using</a></code> block, when the resource acquisition fails, as a quick way to fix an error condition and try to acquire the resource again.</p>
<div class="fragment"><div class="line">image_type * image;</div>
<div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span> * image_path = image_get_user_avatar();</div>
<div class="line"></div>
<div class="line"><a class="code" href="e4c_8h.html#a4afea611dbbe18fc3e3665166b3cd7bc" title="Opens a block of code with automatic disposal of a resource. ">with</a>(image, e4c_image_dispose){</div>
<div class="line">    image = e4c_image_acquire(image_path);</div>
<div class="line">}<a class="code" href="e4c_8h.html#aeda5446032a08fece73ec569b861a72c" title="Closes a block of code with automatic disposal of a resource. ">use</a>{</div>
<div class="line">    image_show(image);</div>
<div class="line">}<span class="keywordflow">catch</span>(ImageNotFoundException){</div>
<div class="line">    image_path = image_get_default_avatar();</div>
<div class="line">    <a class="code" href="e4c_8h.html#aeb7a4b6d23a08c92e14ce6f496ae6050" title="Repeats the previous with block entirely. ">reacquire</a>(1);</div>
<div class="line">}</div>
</div><!-- fragment --><dl class="section warning"><dt>Warning</dt><dd>If the specified maximum number of attempts is <em>zero</em>, then the <code>with</code> block can eventually be attempted an unlimited number of times. Care should be taken in order not to create an <em>infinite loop</em>.</dd></dl>
<p>Once the resource has been acquired, the <code>use</code> block can also be repeated <em>alone</em> through the keyword <code><a class="el" href="e4c_8h.html#a0593b0774c47f8424effd591c2e93921" title="Repeats the previous try (or use) block entirely. ">retry</a></code>:</p>
<div class="fragment"><div class="line">image_type * image;</div>
<div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span> * image_path = image_get_user_avatar();</div>
<div class="line">display_type * display = display_get_user_screen();</div>
<div class="line"></div>
<div class="line"><a class="code" href="e4c_8h.html#a4afea611dbbe18fc3e3665166b3cd7bc" title="Opens a block of code with automatic disposal of a resource. ">with</a>(image, e4c_image_dispose){</div>
<div class="line">    image = e4c_image_acquire(image_path);</div>
<div class="line">}<a class="code" href="e4c_8h.html#aeda5446032a08fece73ec569b861a72c" title="Closes a block of code with automatic disposal of a resource. ">use</a>{</div>
<div class="line">    image_show(image, display);</div>
<div class="line">}<span class="keywordflow">catch</span>(ImageNotFoundException){</div>
<div class="line">    image_path = image_get_default_avatar();</div>
<div class="line">    <a class="code" href="e4c_8h.html#aeb7a4b6d23a08c92e14ce6f496ae6050" title="Repeats the previous with block entirely. ">reacquire</a>(1);</div>
<div class="line">}<span class="keywordflow">catch</span>(DisplayException){</div>
<div class="line">    display = display_get_default_screen();</div>
<div class="line">    <a class="code" href="e4c_8h.html#a0593b0774c47f8424effd591c2e93921" title="Repeats the previous try (or use) block entirely. ">retry</a>(1);</div>
<div class="line">}</div>
</div><!-- fragment --><dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>The <code>reacquire</code> keyword <b>must</b> be used from a <code>catch</code> or <code>finally</code> block, preceded by <code>with</code>... <code>use</code> or <code>using</code> blocks.</li>
<li>A program (or thread) <b>must</b> begin an exception context prior to using the keyword <code>reacquire</code>. Such programming error will lead to an abrupt exit of the program (or thread). </li>
</ul>
</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd><ul>
<li>This macro won't return control unless the <code>with</code> block has already been attempted, at least, the specified maximum number of times.</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a0593b0774c47f8424effd591c2e93921" title="Repeats the previous try (or use) block entirely. ">retry</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a4afea611dbbe18fc3e3665166b3cd7bc" title="Opens a block of code with automatic disposal of a resource. ">with</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#aeda5446032a08fece73ec569b861a72c" title="Closes a block of code with automatic disposal of a resource. ">use</a> </dd></dl>

</div>
</div>
<a class="anchor" id="adc36ba3503172106c15ca4812ef80909"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define rethrow</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">message)</td><td></td>
          <td>&#160;&#160;&#160;E4C_RETHROW(message)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Throws again the currently thrown exception, with a new message. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">message</td><td>The new message describing the exception. It should be more specific than the current one</td></tr>
  </table>
  </dd>
</dl>
<p>This macro creates a new instance of the thrown exception, with a more specific message.</p>
<p><code>rethrow</code> is intended to be used within a <code><a class="el" href="e4c_8h.html#a629585c5169ebdb440b9015f8e87b4df" title="Introduces a block of code capable of handling a specific type of exceptions. ">catch</a></code> block; the purpose is to refine the message of the currently caught exception. The previous exception (and its message) will be stored as the <em>cause</em> of the newly thrown exception.</p>
<div class="fragment"><div class="line"><span class="keywordflow">try</span>{</div>
<div class="line">    image = read_file(file_path);</div>
<div class="line">}<span class="keywordflow">catch</span>(FileOpenException){</div>
<div class="line">    <a class="code" href="e4c_8h.html#adc36ba3503172106c15ca4812ef80909" title="Throws again the currently thrown exception, with a new message. ">rethrow</a>(<span class="stringliteral">&quot;Image not found.&quot;</span>);</div>
<div class="line">}</div>
</div><!-- fragment --><p>The semantics of this keyword are the same as for <code>throw</code>.</p>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>A program (or thread) <b>must</b> begin an exception context prior to using the keyword <code>rethrow</code>. Such programming error will lead to an abrupt exit of the program (or thread). </li>
</ul>
</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd><ul>
<li>Control does not return to the <code>rethrow</code> point.</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a482d649fcaafd28584629da3606e4ea7" title="Signals an exceptional situation represented by an exception object. ">throw</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#abd7bd21e95cfdf7ef4f840abf0467887" title="Throws again the currently thrown exception, with a new, formatted message. ">rethrowf</a> </dd></dl>

</div>
</div>
<a class="anchor" id="abd7bd21e95cfdf7ef4f840abf0467887"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define rethrowf</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">format, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">\</div>
<div class="line">        E4C_RETHROWF( (format), __VA_ARGS__ )</div>
</div><!-- fragment -->
<p>Throws again the currently thrown exception, with a new, formatted message. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">format</td><td>The string containing the specifications that determine the output format for the variadic arguments. </td></tr>
    <tr><td class="paramname">...</td><td>The variadic arguments that will be formatted according to the format control.</td></tr>
  </table>
  </dd>
</dl>
<p>This is a handy way to create (and then <code><a class="el" href="e4c_8h.html#a482d649fcaafd28584629da3606e4ea7" title="Signals an exceptional situation represented by an exception object. ">throw</a></code>) a new instance of the currently thrown exception, with a more specific, formatted message.</p>
<div class="fragment"><div class="line"><span class="keywordflow">try</span>{</div>
<div class="line">    image = read_file(file_path);</div>
<div class="line">}<span class="keywordflow">catch</span>(FileOpenException){</div>
<div class="line">    <a class="code" href="e4c_8h.html#abd7bd21e95cfdf7ef4f840abf0467887" title="Throws again the currently thrown exception, with a new, formatted message. ">rethrowf</a>(<span class="stringliteral">&quot;Image &#39;%s&#39; not found.&quot;</span>, title);</div>
<div class="line">}</div>
</div><!-- fragment --><p>This macro relies on two features that were introduced in the <b>ISO/IEC 9899:1999</b> (also known as <em>C99</em>) revision of the C programming language standard in 1999:</p>
<ul>
<li>Variadic macros</li>
<li>Buffer-safe function <code>vsnprintf</code></li>
</ul>
<p>In order not to create compatibility issues, this macro will only be defined when the <code>__STDC_VERSION__</code> <em>compile-time</em> parameter is defined as a <code>long</code> value <em>greater than or equal to</em> <code>199901L</code>, or when <code>HAVE_C99_VARIADIC_MACROS</code> is defined.</p>
<p>The semantics of this keyword are the same as for <code>throw</code>.</p>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>A program (or thread) <b>must</b> begin an exception context prior to using the keyword <code>rethrowf</code>. Such programming error will lead to an abrupt exit of the program (or thread).</li>
<li>At least one argument <b>must</b> be passed right after the format string. The message will be composed through the function <code>vsnprintf</code> with the specified format and variadic arguments. For further information on formatting rules, you may look up the specifications for the function <code>vsnprintf</code>. </li>
</ul>
</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd><ul>
<li>Control does not return to the <code>rethrowf</code> point.</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#adc36ba3503172106c15ca4812ef80909" title="Throws again the currently thrown exception, with a new message. ">rethrow</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a76c8e6dc2aec197fc2056b64d8e1c83e" title="Throws an exception with a formatted message. ">throwf</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a0593b0774c47f8424effd591c2e93921"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define retry</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">max_retry_attempts)</td><td></td>
          <td>&#160;&#160;&#160;E4C_RETRY(max_retry_attempts)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Repeats the previous <code><a class="el" href="e4c_8h.html#a28599e8ac99ea9faff60a2258a914aee" title="Introduces a block of code aware of exceptions. ">try</a></code> (or <code><a class="el" href="e4c_8h.html#aeda5446032a08fece73ec569b861a72c" title="Closes a block of code with automatic disposal of a resource. ">use</a></code>) block entirely. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">max_retry_attempts</td><td>The maximum number of attempts to retry</td></tr>
  </table>
  </dd>
</dl>
<p>This macro discards any thrown exception (if any) and repeats the previous <code>try</code> or <code>use</code> block, up to a specified maximum number of attempts. It is intended to be used within <code><a class="el" href="e4c_8h.html#a629585c5169ebdb440b9015f8e87b4df" title="Introduces a block of code capable of handling a specific type of exceptions. ">catch</a></code> or <code><a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a></code> blocks as a quick way to fix an error condition and <em>try again</em>.</p>
<p>If the block has already been <em>tried</em> at least the specified number of times, then the program continues by the next line following <code>retry</code> clause.</p>
<div class="fragment"><div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span> * file_path = config_get_user_defined_file_path();</div>
<div class="line"></div>
<div class="line"><span class="keywordflow">try</span>{</div>
<div class="line">    config = read_config(file_path);</div>
<div class="line">}<span class="keywordflow">catch</span>(ConfigException){</div>
<div class="line">    file_path = config_get_default_file_path();</div>
<div class="line">    <a class="code" href="e4c_8h.html#a0593b0774c47f8424effd591c2e93921" title="Repeats the previous try (or use) block entirely. ">retry</a>(1);</div>
<div class="line">    <a class="code" href="e4c_8h.html#adc36ba3503172106c15ca4812ef80909" title="Throws again the currently thrown exception, with a new message. ">rethrow</a>(<span class="stringliteral">&quot;Wrong defaults.&quot;</span>);</div>
<div class="line">}</div>
</div><!-- fragment --><dl class="section warning"><dt>Warning</dt><dd>If the specified maximum number of attempts is <em>zero</em>, then the block can eventually be attempted an unlimited number of times. Care should be taken in order not to create an <em>infinite loop</em>.</dd></dl>
<p>This macro won't return control unless the block has already been attempted, at least, the specified maximum number of times.</p>
<dl class="section note"><dt>Note</dt><dd>Once a <code>catch</code> code block is being executed, the current exception is considered caught. If you want the exception to be propagated when the maximum number of attempts has been reached, then you need to <code><a class="el" href="e4c_8h.html#adc36ba3503172106c15ca4812ef80909" title="Throws again the currently thrown exception, with a new message. ">rethrow</a></code> it.</dd></dl>
<div class="fragment"><div class="line"><span class="keywordtype">int</span> dividend = 100;</div>
<div class="line"><span class="keywordtype">int</span> divisor = 0;</div>
<div class="line"><span class="keywordtype">int</span> result = 0;</div>
<div class="line"></div>
<div class="line"><span class="keywordflow">try</span>{</div>
<div class="line">    result = dividend / divisor;</div>
<div class="line">    do_something(result);</div>
<div class="line">}<span class="keywordflow">catch</span>(RuntimeException){</div>
<div class="line">    divisor = 1;</div>
<div class="line">    <a class="code" href="e4c_8h.html#a0593b0774c47f8424effd591c2e93921" title="Repeats the previous try (or use) block entirely. ">retry</a>(1);</div>
<div class="line">    <a class="code" href="e4c_8h.html#adc36ba3503172106c15ca4812ef80909" title="Throws again the currently thrown exception, with a new message. ">rethrow</a>(<span class="stringliteral">&quot;Error (not a division by zero).&quot;</span>);</div>
<div class="line">}</div>
</div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>At a <code>finally</code> block, the current exception (if any) will be propagated when the <code>retry</code> does not take place, so you don't need to <code>rethrow</code> it again.</dd></dl>
<div class="fragment"><div class="line"><span class="keywordtype">int</span> dividend = 100;</div>
<div class="line"><span class="keywordtype">int</span> divisor = 0;</div>
<div class="line"><span class="keywordtype">int</span> result = 0;</div>
<div class="line"></div>
<div class="line"><span class="keywordflow">try</span>{</div>
<div class="line">    result = dividend / divisor;</div>
<div class="line">    do_something(result);</div>
<div class="line">}<span class="keywordflow">finally</span>{</div>
<div class="line">    <span class="keywordflow">if</span>( e4c_get_status() == <a class="code" href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50a3e25fc733de62745054a380444ada211" title="There was an exception and it wasn&#39;t caught. ">e4c_failed</a> ){</div>
<div class="line">        divisor = 1;</div>
<div class="line">        <a class="code" href="e4c_8h.html#a0593b0774c47f8424effd591c2e93921" title="Repeats the previous try (or use) block entirely. ">retry</a>(1);</div>
<div class="line">        <span class="comment">// when we get here, the exception will be propagated</span></div>
<div class="line">    }</div>
<div class="line">}</div>
</div><!-- fragment --><dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>A program (or thread) <b>must</b> begin an exception context prior to using the keyword <code>retry</code>. Such programming error will lead to an abrupt exit of the program (or thread).</li>
<li>The <code>retry</code> keyword <b>must</b> be used from a <code>catch</code> or <code>finally</code> block. </li>
</ul>
</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd><ul>
<li>Control does not return to the <code>retry</code> point, unless the <code>try</code> (or <code>use</code>) block has already been attempted, at least, the specified number of times.</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#aeb7a4b6d23a08c92e14ce6f496ae6050" title="Repeats the previous with block entirely. ">reacquire</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a28599e8ac99ea9faff60a2258a914aee" title="Introduces a block of code aware of exceptions. ">try</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#aeda5446032a08fece73ec569b861a72c" title="Closes a block of code with automatic disposal of a resource. ">use</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a482d649fcaafd28584629da3606e4ea7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define throw</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">exception_type, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">message&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;E4C_THROW(exception_type, message)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Signals an exceptional situation represented by an exception object. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">exception_type</td><td>The type of exception to be thrown </td></tr>
    <tr><td class="paramname">message</td><td>The <em>ad-hoc</em> message describing the exception. If <code>NULL</code>, then the default message for the specified exception type will be used</td></tr>
  </table>
  </dd>
</dl>
<p>Creates a new instance of the specified type of exception and then throws it. The message is copied into the thrown exception, so it may be freely deallocated. If <code>NULL</code> is passed, then the default message for that type of exception will be used.</p>
<p>When an exception is thrown, the exception handling framework looks for the appropriate <code><a class="el" href="e4c_8h.html#a629585c5169ebdb440b9015f8e87b4df" title="Introduces a block of code capable of handling a specific type of exceptions. ">catch</a></code> block that can handle the exception. The system unwinds the call chain of the program and executes the <code><a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a></code> blocks it finds.</p>
<p>When no <code>catch</code> block is able to handle an exception, the system eventually gets to the main function of the program. This situation is called an <b>uncaught exception</b>.</p>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>A program (or thread) <b>must</b> begin an exception context prior to using the keyword <code>throw</code>. Such programming error will lead to an abrupt exit of the program (or thread). </li>
</ul>
</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd><ul>
<li>Control does not return to the <code>throw</code> point.</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a76c8e6dc2aec197fc2056b64d8e1c83e" title="Throws an exception with a formatted message. ">throwf</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#adc36ba3503172106c15ca4812ef80909" title="Throws again the currently thrown exception, with a new message. ">rethrow</a> </dd>
<dd>
<a class="el" href="structe4c__exception__type.html" title="Represents an exception type in the exception handling system. ">e4c_exception_type</a> </dd>
<dd>
<a class="el" href="structe4c__exception.html" title="Represents an instance of an exception type. ">e4c_exception</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a06e18483913c9112424bc941e248a532" title="Represents a function which will be executed in the event of an uncaught exception. ">e4c_uncaught_handler</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#ab67ff2dbcdda36ef766b096e7198614d" title="Returns the exception that was thrown. ">e4c_get_exception</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a76c8e6dc2aec197fc2056b64d8e1c83e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define throwf</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">exception_type, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">format, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">\</div>
<div class="line">        E4C_THROWF( (exception_type), (format), __VA_ARGS__ )</div>
</div><!-- fragment -->
<p>Throws an exception with a formatted message. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">exception_type</td><td>The type of exception to be thrown </td></tr>
    <tr><td class="paramname">format</td><td>The string containing the specifications that determine the output format for the variadic arguments </td></tr>
    <tr><td class="paramname">...</td><td>The variadic arguments that will be formatted according to the format control</td></tr>
  </table>
  </dd>
</dl>
<p>This is a handy way to compose a formatted message and <code><a class="el" href="e4c_8h.html#a482d649fcaafd28584629da3606e4ea7" title="Signals an exceptional situation represented by an exception object. ">throw</a></code> an exception <em>on the fly</em>:</p>
<div class="fragment"><div class="line"><span class="keywordtype">int</span> bytes = 1024;</div>
<div class="line"><span class="keywordtype">void</span> * buffer = malloc(bytes);</div>
<div class="line"><span class="keywordflow">if</span>(buffer == NULL){</div>
<div class="line">    <a class="code" href="e4c_8h.html#a76c8e6dc2aec197fc2056b64d8e1c83e" title="Throws an exception with a formatted message. ">throwf</a>(NotEnoughMemoryException, <span class="stringliteral">&quot;Could not allocate %d bytes.&quot;</span>, bytes);</div>
<div class="line">}</div>
</div><!-- fragment --><p>This macro relies on two features that were introduced in the <b>ISO/IEC 9899:1999</b> (also known as <em>C99</em>) revision of the C programming language standard in 1999:</p>
<ul>
<li>Variadic macros</li>
<li>Buffer-safe function <code>vsnprintf</code></li>
</ul>
<p>In order not to create compatibility issues, this macro will only be defined when the <code>__STDC_VERSION__</code> <em>compile-time</em> parameter is defined as a <code>long</code> value <em>greater than or equal to</em> <code>199901L</code>, or when <code>HAVE_C99_VARIADIC_MACROS</code> is defined.</p>
<p>The semantics of this keyword are the same as for <code>throw</code>.</p>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>A program (or thread) <b>must</b> begin an exception context prior to using the keyword <code>throwf</code>. Such programming error will lead to an abrupt exit of the program (or thread).</li>
<li>At least one argument <b>must</b> be passed right after the format string. The message will be composed through the function <code>vsnprintf</code> with the specified format and variadic arguments. For further information on formatting rules, you may look up the specifications for the function <code>vsnprintf</code>. </li>
</ul>
</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd><ul>
<li>Control does not return to the <code>throwf</code> point.</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a482d649fcaafd28584629da3606e4ea7" title="Signals an exceptional situation represented by an exception object. ">throw</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#abd7bd21e95cfdf7ef4f840abf0467887" title="Throws again the currently thrown exception, with a new, formatted message. ">rethrowf</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a28599e8ac99ea9faff60a2258a914aee"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define try&#160;&#160;&#160;E4C_TRY</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Introduces a block of code aware of exceptions. </p>
<p>A <code><a class="el" href="e4c_8h.html#a28599e8ac99ea9faff60a2258a914aee" title="Introduces a block of code aware of exceptions. ">try</a></code> statement executes a block of code. If an exception is thrown and there is a <code><a class="el" href="e4c_8h.html#a629585c5169ebdb440b9015f8e87b4df" title="Introduces a block of code capable of handling a specific type of exceptions. ">catch</a></code> block that can handle it, then control will be transferred to it. If there is a <code><a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a></code> block, then it will be executed, no matter whether the <code>try</code> block completes normally or abruptly, and no matter whether a <code>catch</code> block is first given control.</p>
<p>The block of code immediately after the keyword <code>try</code> is called <b>the <code>try</code> block</b> of the <code>try</code> statement. The block of code immediately after the keyword <code>finally</code> is called <b>the <code>finally</code> block</b> of the <code>try</code> statement.</p>
<div class="fragment"><div class="line">stack_t * stack = stack_new();</div>
<div class="line"><span class="keywordflow">try</span>{</div>
<div class="line">    <span class="comment">// the try block</span></div>
<div class="line">    <span class="keywordtype">int</span> value = stack_pop(stack);</div>
<div class="line">    stack_push(stack, 16);</div>
<div class="line">    stack_push(stack, 32);</div>
<div class="line">}<span class="keywordflow">catch</span>(StackOverflowException){</div>
<div class="line">    <span class="comment">// a catch block</span></div>
<div class="line">    printf(<span class="stringliteral">&quot;Could not push.&quot;</span>);</div>
<div class="line">}<span class="keywordflow">catch</span>(StackUnderflowException){</div>
<div class="line">    <span class="comment">// another catch block</span></div>
<div class="line">    printf(<span class="stringliteral">&quot;Could not pop.&quot;</span>);</div>
<div class="line">}<span class="keywordflow">finally</span>{</div>
<div class="line">    <span class="comment">// the finally block</span></div>
<div class="line">    stack_delete(stack);</div>
<div class="line">}</div>
</div><!-- fragment --><p>One <code>try</code> block may precede many <code>catch</code> blocks (also called <em>exception handlers</em>). A <code>catch</code> block <b>must</b> have exactly one parameter, which is the exception type it is capable of handling. Within the <code>catch</code> block, the exception can be accessed through the function <code><a class="el" href="e4c_8h.html#ab67ff2dbcdda36ef766b096e7198614d" title="Returns the exception that was thrown. ">e4c_get_exception</a></code>. Exception handlers are considered in left-to-right order: the earliest possible <code>catch</code> block handles the exception. If no <code>catch</code> block can handle the thrown exception, it will be <em>propagated</em>.</p>
<p>Sometimes it may come in handy to <code><a class="el" href="e4c_8h.html#a0593b0774c47f8424effd591c2e93921" title="Repeats the previous try (or use) block entirely. ">retry</a></code> an entire <code>try</code> block; for instance, once the exception has been caught and the error condition has been solved.</p>
<p>A <code>try</code> block has an associated <a class="el" href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50">status</a> according to the way it has been executed:</p>
<ul>
<li>It <em>succeeds</em> when the execution reaches the end of the block without any exceptions.</li>
<li>It <em>recovers</em> when an exception is thrown but a <code>catch</code> block handles it.</li>
<li>It <em>fails</em> when an exception is thrown and it's not caught.</li>
</ul>
<p>The status of the current <code>try</code> block can be retrieved through the function <code><a class="el" href="e4c_8h.html#a961e9d117c98424796ae769f2b2e6b26" title="Returns the completeness status of the executing code block. ">e4c_get_status</a></code>.</p>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>A program (or thread) <b>must</b> begin an exception context prior to using the keyword <code>try</code>. Such programming error will lead to an abrupt exit of the program (or thread).</li>
<li>A <code>try</code> block <b>must</b> precede, at least, another block of code, introduced by either <code>catch</code> or <code>finally</code>.<ul>
<li>A <code>try</code> block may precede several <code>catch</code> blocks.</li>
<li>A <code>try</code> block can precede, at most, one <code>finally</code> block.</li>
</ul>
</li>
<li>A <code>try</code> block <b>must not</b> be exited through any of: <code>goto</code>, <code>break</code>, <code>continue</code> or <code>return</code> (but it is legal to <code><a class="el" href="e4c_8h.html#a482d649fcaafd28584629da3606e4ea7" title="Signals an exceptional situation represented by an exception object. ">throw</a></code> an exception).</li>
</ul>
</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd><ul>
<li>A <code>finally</code> block will be executed after the <code>try</code> block and any <code>catch</code> block that might be executed, no matter whether the <code>try</code> block <em>succeeds</em>, <em>recovers</em> or <em>fails</em>.</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a629585c5169ebdb440b9015f8e87b4df" title="Introduces a block of code capable of handling a specific type of exceptions. ">catch</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a0593b0774c47f8424effd591c2e93921" title="Repeats the previous try (or use) block entirely. ">retry</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50" title="Represents the completeness of a code block aware of exceptions. ">e4c_status</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a961e9d117c98424796ae769f2b2e6b26" title="Returns the completeness status of the executing code block. ">e4c_get_status</a> </dd></dl>

</div>
</div>
<a class="anchor" id="aeda5446032a08fece73ec569b861a72c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define use&#160;&#160;&#160;E4C_USE</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Closes a block of code with automatic disposal of a resource. </p>
<p>A <code><a class="el" href="e4c_8h.html#aeda5446032a08fece73ec569b861a72c" title="Closes a block of code with automatic disposal of a resource. ">use</a></code> block <b>must</b> always be preceded by a <code>with</code> block. These two keywords are designed so the compiler will complain about <em>dangling</em> <code>with</code>... <code>use</code> blocks.</p>
<p>A code block introduced by the <code>use</code> keyword will only be executed <em>if, and only if</em>, the acquisition of the resource <em>completes</em> without exceptions.</p>
<p>The disposal function will be executed, either if the <code>use</code> block completes or not.</p>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>A <code>use</code> block <b>must</b> be preceded by a <code>with</code> block.</li>
<li>A <code>use</code> block <b>must not</b> be exited through any of: <code>goto</code>, <code>break</code>, <code>continue</code> or <code>return</code> (but it is legal to <code><a class="el" href="e4c_8h.html#a482d649fcaafd28584629da3606e4ea7" title="Signals an exceptional situation represented by an exception object. ">throw</a></code> an exception).</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a4afea611dbbe18fc3e3665166b3cd7bc" title="Opens a block of code with automatic disposal of a resource. ">with</a> </dd></dl>

</div>
</div>
<a class="anchor" id="abe1fc0d5310579fdfe7cca02506d06c2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define using</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">type, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">resource, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">args&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;E4C_USING(type, resource, args)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Introduces a block of code with automatic acquisition and disposal of a resource. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>The type of the resource </td></tr>
    <tr><td class="paramname">resource</td><td>The resource to be acquired, used and then disposed </td></tr>
    <tr><td class="paramname">args</td><td>A list of arguments to be passed to the acquisition function</td></tr>
  </table>
  </dd>
</dl>
<p>The specified resource will be <em>acquired</em>, <em>used</em> and then <em>disposed</em>. The automatic acquisition and disposal is achieved by calling the <em>implicit</em> functions <b>e4c_acquire_<em>type</em></b> and <b>e4c_dispose_<em>type</em></b>:</p>
<ul>
<li><code>TYPE e4c_acquire_TYPE(ARGS)</code></li>
<li><code>void e4c_dispose_TYPE(TYPE RESOURCE, E4C_BOOL failed)</code></li>
</ul>
<p>These two symbols <b>must</b> exist, in the form of either <em>functions</em> or <em>macros</em>.</p>
<p>The semantics of the automatic acquisition and disposal are the same as for blocks introduced by <code><a class="el" href="e4c_8h.html#a4afea611dbbe18fc3e3665166b3cd7bc" title="Opens a block of code with automatic disposal of a resource. ">with</a></code>... <code><a class="el" href="e4c_8h.html#aeda5446032a08fece73ec569b861a72c" title="Closes a block of code with automatic disposal of a resource. ">use</a></code>. For example, a <code>using</code> block can also precede <code><a class="el" href="e4c_8h.html#a629585c5169ebdb440b9015f8e87b4df" title="Introduces a block of code capable of handling a specific type of exceptions. ">catch</a></code> and <code><a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a></code> blocks.</p>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>A program (or thread) <b>must</b> begin an exception context prior to using the keyword <code>using</code>. Such programming error will lead to an abrupt exit of the program (or thread).</li>
<li>A <code>using</code> block <b>must not</b> be exited through any of: <code>goto</code>, <code>break</code>, <code>continue</code> or <code>return</code> (but it is legal to <code><a class="el" href="e4c_8h.html#a482d649fcaafd28584629da3606e4ea7" title="Signals an exceptional situation represented by an exception object. ">throw</a></code> an exception).</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a4afea611dbbe18fc3e3665166b3cd7bc" title="Opens a block of code with automatic disposal of a resource. ">with</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a4afea611dbbe18fc3e3665166b3cd7bc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define with</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">resource, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">dispose&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;E4C_WITH(resource, dispose)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Opens a block of code with automatic disposal of a resource. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resource</td><td>The resource to be disposed </td></tr>
    <tr><td class="paramname">dispose</td><td>The name of the disposal function (or macro)</td></tr>
  </table>
  </dd>
</dl>
<p>The combination of keywords <code>with</code>... <code><a class="el" href="e4c_8h.html#aeda5446032a08fece73ec569b861a72c" title="Closes a block of code with automatic disposal of a resource. ">use</a></code> encapsules the <em>Dispose Pattern</em>. This pattern consists of two separate blocks and an implicit call to a given function:</p>
<ul>
<li>the <code>with</code> block is responsible for the resource acquisition</li>
<li>the <code>use</code> block makes use of the resource</li>
<li>the disposal function will be called implicitly</li>
</ul>
<p>A <code>with</code> block <b>must</b> be followed by a <code>use</code> block. In addition, the <code>use</code> block may be followed by several <code><a class="el" href="e4c_8h.html#a629585c5169ebdb440b9015f8e87b4df" title="Introduces a block of code capable of handling a specific type of exceptions. ">catch</a></code> blocks and/or one <code><a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a></code> block.</p>
<p>The <code>with</code> keyword guarantees that the disposal function will be called <b>if, and only if</b>, the acquisition block is <em>completed</em> without any errors (i.e. the acquisition block does not <code><a class="el" href="e4c_8h.html#a482d649fcaafd28584629da3606e4ea7" title="Signals an exceptional situation represented by an exception object. ">throw</a></code> any exceptions).</p>
<p>If the <code>with</code> block does not complete, neither the disposal function nor the <code>use</code> block will be executed.</p>
<p>The disposal function is called right after the <code>use</code> block. If an exception is thrown, the <code>catch</code> or <code>finally</code> blocks (if any) will take place <b>after</b> the disposal of the resource.</p>
<p>When called, the disposal function will receive two arguments:</p>
<ul>
<li>The resource</li>
<li>A boolean flag indicating if the <code>use</code> block <em>failed</em> (i. e. did not <em>complete</em>)</li>
</ul>
<p>This way, different actions can be taken depending on the success or failure of the block. For example, commiting or rolling back a <em>transaction</em> resource.</p>
<p>Legacy functions can be reused by defining macros. For example, a file resource needs to be closed regardless of the errors occurred. Since the function <code>fclose</code> only takes one parameter, we could define the next macro:</p>
<div class="fragment"><div class="line"><span class="preprocessor"># define e4c_dispose_file(file , failed) fclose(file)</span></div>
</div><!-- fragment --><p>Here is the typical usage of <code>with</code>... <code>use</code>:</p>
<div class="fragment"><div class="line"><a class="code" href="e4c_8h.html#a4afea611dbbe18fc3e3665166b3cd7bc" title="Opens a block of code with automatic disposal of a resource. ">with</a>(foo, e4c_dispose_foo){</div>
<div class="line">    foo = e4c_acquire_foo(foobar);</div>
<div class="line">    validate_foo(foo, bar);</div>
<div class="line">    ...</div>
<div class="line">}<a class="code" href="e4c_8h.html#aeda5446032a08fece73ec569b861a72c" title="Closes a block of code with automatic disposal of a resource. ">use</a>{</div>
<div class="line">    do_something(foo);</div>
<div class="line">    ...</div>
<div class="line">}<span class="keywordflow">catch</span>(FooAcquisitionFailed){</div>
<div class="line">    recover1(foobar);</div>
<div class="line">    ...</div>
<div class="line">}<span class="keywordflow">catch</span>(SomethingElseFailed){</div>
<div class="line">    recover2(foo);</div>
<div class="line">    ...</div>
<div class="line">}<span class="keywordflow">finally</span>{</div>
<div class="line">    cleanup();</div>
<div class="line">    ...</div>
<div class="line">}</div>
</div><!-- fragment --><p>Nonetheless, <em>one-liners</em> fit nicely too:</p>
<div class="fragment"><div class="line"><a class="code" href="e4c_8h.html#a4afea611dbbe18fc3e3665166b3cd7bc" title="Opens a block of code with automatic disposal of a resource. ">with</a>(bar, e4c_dispose_bar) bar = e4c_acquire_bar(baz, 123); <a class="code" href="e4c_8h.html#aeda5446032a08fece73ec569b861a72c" title="Closes a block of code with automatic disposal of a resource. ">use</a> foo(bar);</div>
</div><!-- fragment --><p>There is a way to lighten up even more this pattern by defining convenience macros, customized for a specific kind of resources. For example, <code><a class="el" href="e4c__rsc_8h.html#ab95c95244edfd564ed80fb5425e80ec5" title="Introduces a block of code with automatic acquisition and disposal of a file stream. ">e4c_using_file</a></code> or <code><a class="el" href="e4c__rsc_8h.html#aed2e1edbae50abc57029677111ee492a" title="Introduces a block of code with automatic acquisition and disposal of a memory buffer. ">e4c_using_memory</a></code>.</p>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>A program (or thread) <b>must</b> begin an exception context prior to using the keyword <code>with</code>. Such programming error will lead to an abrupt exit of the program (or thread).</li>
<li>A <code>with</code> block <b>must not</b> be exited through any of: <code>goto</code>, <code>break</code>, <code>continue</code> or <code>return</code> (but it is legal to <code>throw</code> an exception).</li>
<li>A <code>with</code> block <b>must</b> always be followed by a <code>use</code> block.</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#aeda5446032a08fece73ec569b861a72c" title="Closes a block of code with automatic disposal of a resource. ">use</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#abe1fc0d5310579fdfe7cca02506d06c2" title="Introduces a block of code with automatic acquisition and disposal of a resource. ...">using</a> </dd></dl>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="ad8b769fde61d9bc8154bff6939331042"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void(* e4c_finalize_handler)(void *custom_data)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Represents a function which will be executed whenever an exception is destroyed. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">custom_data</td><td>The "custom data" of the exception to be discarded</td></tr>
  </table>
  </dd>
</dl>
<p>When this handler is set, it will be called any time an exception is discarded. It will be passed the <em>custom_data</em> of the exception, so it may dispose resources previously acquired by the <em>initialize handler</em>.</p>
<p>This handler can be set through the function <code><a class="el" href="e4c_8h.html#a8fae2739e3fc3823624dc35d9ea396ae" title="Sets the optional handlers of an exception context. ">e4c_context_set_handlers</a></code>:</p>
<div class="fragment"><div class="line"><span class="keywordtype">void</span> * initialize_data(<span class="keyword">const</span> <a class="code" href="structe4c__exception.html" title="Represents an instance of an exception type. ">e4c_exception</a> * exception){</div>
<div class="line"></div>
<div class="line">    <span class="keyword">const</span> <span class="keywordtype">char</span> * custom_data = malloc(1024);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span>(custom_data != NULL){</div>
<div class="line">        <span class="keywordflow">if</span>( e4c_is_instance_of(exception, &amp;SignalException) ){</div>
<div class="line">            strcpy(custom_data, <span class="stringliteral">&quot;SIGNAL ERROR&quot;</span>);</div>
<div class="line">        }<span class="keywordflow">else</span>{</div>
<div class="line">            strcpy(custom_data, <span class="stringliteral">&quot;RUNTIME ERROR&quot;</span>);</div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">return</span>(custom_data);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> * finalize_data(<span class="keywordtype">void</span> * custom_data){</div>
<div class="line"></div>
<div class="line">    free(custom_data);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> * argv[]){</div>
<div class="line"></div>
<div class="line">    <a class="code" href="e4c_8h.html#a27678c11fa7d4e2a9436f527cc194013" title="Introduces a block of code which will use a new exception context. ">e4c_using_context</a>(E4C_TRUE){</div>
<div class="line"></div>
<div class="line">        e4c_context_set_handlers(NULL, NULL, initialize_data, finalize_data);</div>
<div class="line">        ...</div>
<div class="line">    }</div>
<div class="line">}</div>
</div><!-- fragment --><dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a8fae2739e3fc3823624dc35d9ea396ae" title="Sets the optional handlers of an exception context. ">e4c_context_set_handlers</a> </dd>
<dd>
<a class="el" href="structe4c__exception.html" title="Represents an instance of an exception type. ">e4c_exception</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#ad8b769fde61d9bc8154bff6939331042" title="Represents a function which will be executed whenever an exception is destroyed. ">e4c_finalize_handler</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a06e18483913c9112424bc941e248a532" title="Represents a function which will be executed in the event of an uncaught exception. ">e4c_uncaught_handler</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#ad129f3e99e1483f691c8f3134f85740b" title="Prints a fatal error message regarding the specified exception. ">e4c_print_exception</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a8ca7a4f5a33acd2bb2ed30a8d9b441de"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void*(* e4c_initialize_handler)(const <a class="el" href="structe4c__exception.html">e4c_exception</a> *exception)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Represents a function which will be executed whenever a new exception is thrown. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">exception</td><td>The newly thrown exception</td></tr>
  </table>
  </dd>
</dl>
<p>When this handler is set, it will be called any time a new exception is created. The <code>void</code> pointer returned by this function will be assigned to the exception's <em>custom_data</em>. This data can be accessed later on, for example, from a <code><a class="el" href="e4c_8h.html#a629585c5169ebdb440b9015f8e87b4df" title="Introduces a block of code capable of handling a specific type of exceptions. ">catch</a></code> block, or an <em>uncaught handler</em>, for any specific purpose.</p>
<p>This handler can be set through the function <code><a class="el" href="e4c_8h.html#a8fae2739e3fc3823624dc35d9ea396ae" title="Sets the optional handlers of an exception context. ">e4c_context_set_handlers</a></code>:</p>
<div class="fragment"><div class="line"><span class="keywordtype">void</span> * my_initialize_handler(<span class="keyword">const</span> <a class="code" href="structe4c__exception.html" title="Represents an instance of an exception type. ">e4c_exception</a> * e){</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span>( e4c_is_instance_of(e, &amp;SignalException) ){</div>
<div class="line">        printf(<span class="stringliteral">&quot;Program received signal %s (%d)!\n&quot;</span>, e-&gt;<a class="code" href="structe4c__exception.html#a2f983e113301d06bf899eaf1240e5a7d" title="The path of the source code file from which the exception was thrown. ">file</a>, e-&gt;<a class="code" href="structe4c__exception.html#ad29dcf039519b17f869dc896c53193ee" title="The number of line from which the exception was thrown. ">line</a>);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">return</span>(NULL);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> * argv[]){</div>
<div class="line"></div>
<div class="line">    <a class="code" href="e4c_8h.html#a27678c11fa7d4e2a9436f527cc194013" title="Introduces a block of code which will use a new exception context. ">e4c_using_context</a>(E4C_TRUE){</div>
<div class="line"></div>
<div class="line">        e4c_context_set_handlers(NULL, NULL, my_initialize_handler, NULL);</div>
<div class="line">        <span class="comment">// ...</span></div>
<div class="line">    }</div>
<div class="line">}</div>
</div><!-- fragment --><p>By the time this handler is called, the exception already has been assigned the initial value specified for <code>custom_data</code>, so the handler may make use of it:</p>
<div class="fragment"><div class="line"><span class="keywordtype">void</span> * log_handler(<span class="keyword">const</span> <a class="code" href="structe4c__exception.html" title="Represents an instance of an exception type. ">e4c_exception</a> * e){</div>
<div class="line"></div>
<div class="line">    printf(<span class="stringliteral">&quot;LOG: Exception thrown at module &#39;%s&#39;\n&quot;</span>, e-&gt;<a class="code" href="structe4c__exception.html#afdff5af3161edda0a23bf19de1764f74" title="Custom data associated to this exception. ">custom_data</a>);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">return</span>(NULL);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> * argv[]){</div>
<div class="line"></div>
<div class="line">    <a class="code" href="e4c_8h.html#a27678c11fa7d4e2a9436f527cc194013" title="Introduces a block of code which will use a new exception context. ">e4c_using_context</a>(E4C_TRUE){</div>
<div class="line"></div>
<div class="line">        e4c_context_set_handlers(NULL, <span class="stringliteral">&quot;FOO&quot;</span>, log_handler, NULL);</div>
<div class="line">        <span class="comment">// ...</span></div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <a class="code" href="e4c_8h.html#a27678c11fa7d4e2a9436f527cc194013" title="Introduces a block of code which will use a new exception context. ">e4c_using_context</a>(E4C_TRUE){</div>
<div class="line"></div>
<div class="line">        e4c_context_set_handlers(NULL, <span class="stringliteral">&quot;BAR&quot;</span>, log_handler, NULL);</div>
<div class="line">        <span class="comment">// ...</span></div>
<div class="line">    }</div>
<div class="line">}</div>
</div><!-- fragment --><dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a8fae2739e3fc3823624dc35d9ea396ae" title="Sets the optional handlers of an exception context. ">e4c_context_set_handlers</a> </dd>
<dd>
<a class="el" href="structe4c__exception.html" title="Represents an instance of an exception type. ">e4c_exception</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#ad8b769fde61d9bc8154bff6939331042" title="Represents a function which will be executed whenever an exception is destroyed. ">e4c_finalize_handler</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a06e18483913c9112424bc941e248a532" title="Represents a function which will be executed in the event of an uncaught exception. ">e4c_uncaught_handler</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#ad129f3e99e1483f691c8f3134f85740b" title="Prints a fatal error message regarding the specified exception. ">e4c_print_exception</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a06e18483913c9112424bc941e248a532"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void(* e4c_uncaught_handler)(const <a class="el" href="structe4c__exception.html">e4c_exception</a> *exception)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Represents a function which will be executed in the event of an uncaught exception. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">exception</td><td>The uncaught exception</td></tr>
  </table>
  </dd>
</dl>
<p>This handler can be set through the function <code><a class="el" href="e4c_8h.html#a8fae2739e3fc3823624dc35d9ea396ae" title="Sets the optional handlers of an exception context. ">e4c_context_set_handlers</a></code>:</p>
<div class="fragment"><div class="line"><span class="keywordtype">void</span> my_uncaught_handler(<span class="keyword">const</span> <a class="code" href="structe4c__exception.html" title="Represents an instance of an exception type. ">e4c_exception</a> * exception){</div>
<div class="line"></div>
<div class="line">    printf(<span class="stringliteral">&quot;Error: %s (%s)\n&quot;</span>, exception-&gt;<a class="code" href="structe4c__exception.html#a499a293438be058d976d839d49f073b1" title="The name of this exception. ">name</a>, exception-&gt;<a class="code" href="structe4c__exception.html#ab92d64455df83a110d9fc2d17cf1d7bd" title="The message of this exception. ">message</a>);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> * argv[]){</div>
<div class="line"></div>
<div class="line">    <a class="code" href="e4c_8h.html#a27678c11fa7d4e2a9436f527cc194013" title="Introduces a block of code which will use a new exception context. ">e4c_using_context</a>(E4C_TRUE){</div>
<div class="line"></div>
<div class="line">        e4c_context_set_handlers(my_uncaught_handler, NULL, NULL, NULL);</div>
<div class="line">        <span class="comment">// ...</span></div>
<div class="line">    }</div>
<div class="line">}</div>
</div><!-- fragment --><p>There exists a convenience function <code><a class="el" href="e4c_8h.html#ad129f3e99e1483f691c8f3134f85740b" title="Prints a fatal error message regarding the specified exception. ">e4c_print_exception</a></code> which is used as the default <em>uncaught handler</em>, unless otherwise specified. It simply prints information regarding the exception to <code>stderr</code>.</p>
<dl class="section warning"><dt>Warning</dt><dd>An uncaught handler is not allowed to try and recover the current exception context. Moreover, the program (or current thread) will terminate right after the function returns.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a8fae2739e3fc3823624dc35d9ea396ae" title="Sets the optional handlers of an exception context. ">e4c_context_set_handlers</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a8ca7a4f5a33acd2bb2ed30a8d9b441de" title="Represents a function which will be executed whenever a new exception is thrown. ">e4c_initialize_handler</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#ad8b769fde61d9bc8154bff6939331042" title="Represents a function which will be executed whenever an exception is destroyed. ">e4c_finalize_handler</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#ad129f3e99e1483f691c8f3134f85740b" title="Prints a fatal error message regarding the specified exception. ">e4c_print_exception</a> </dd></dl>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="a6cbf5662e61eccb04d74464ab3864d50"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50">e4c_status</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Represents the completeness of a code block aware of exceptions. </p>
<p>The symbolic values representing the status of a block help to distinguish between different possible situations inside a <code><a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a></code> block. For example, different cleanup actions can be taken, depending on the status of the block.</p>
<div class="fragment"><div class="line"><span class="keywordflow">try</span>{</div>
<div class="line">   ...</div>
<div class="line">}<span class="keywordflow">finally</span>{</div>
<div class="line">   <span class="keywordflow">switch</span>( e4c_get_status() ){</div>
<div class="line"></div>
<div class="line">       <span class="keywordflow">case</span> <a class="code" href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50ad78680d90dc3a7e42da9f2eb2ff8e4c9" title="There were no exceptions. ">e4c_succeeded</a>:</div>
<div class="line">           ...</div>
<div class="line">           <span class="keywordflow">break</span>;</div>
<div class="line"></div>
<div class="line">       <span class="keywordflow">case</span> <a class="code" href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50a8d27c3fe156c5e88b8927a45a99903c8" title="There was an exception, but it was caught. ">e4c_recovered</a>:</div>
<div class="line">           ...</div>
<div class="line">           <span class="keywordflow">break</span>;</div>
<div class="line"></div>
<div class="line">       <span class="keywordflow">case</span> <a class="code" href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50a3e25fc733de62745054a380444ada211" title="There was an exception and it wasn&#39;t caught. ">e4c_failed</a>:</div>
<div class="line">           ...</div>
<div class="line">           <span class="keywordflow">break</span>;</div>
<div class="line">   }</div>
<div class="line">}</div>
</div><!-- fragment --><dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a961e9d117c98424796ae769f2b2e6b26" title="Returns the completeness status of the executing code block. ">e4c_get_status</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a> </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a6cbf5662e61eccb04d74464ab3864d50ad78680d90dc3a7e42da9f2eb2ff8e4c9"></a>e4c_succeeded</em>&nbsp;</td><td class="fielddoc">
<p>There were no exceptions. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a6cbf5662e61eccb04d74464ab3864d50a8d27c3fe156c5e88b8927a45a99903c8"></a>e4c_recovered</em>&nbsp;</td><td class="fielddoc">
<p>There was an exception, but it was caught. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a6cbf5662e61eccb04d74464ab3864d50a3e25fc733de62745054a380444ada211"></a>e4c_failed</em>&nbsp;</td><td class="fielddoc">
<p>There was an exception and it wasn't caught. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a1e27be2186952ed77b4591f48c5d11cd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void e4c_context_begin </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>handle_signals</em>)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Begins an exception context. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle_signals</td><td>If <code>true</code>, the signal handling system will be set up with the default mapping.</td></tr>
  </table>
  </dd>
</dl>
<p>This function begins the current exception context to be used by the program (or current thread), until <code><a class="el" href="e4c_8h.html#a7fbe6fb51b19a6485f806c006711ec74" title="Ends the current exception context. ">e4c_context_end</a></code> is called.</p>
<p>The signal handling system can be initialized automatically with the <a class="el" href="e4c_8h.html#ac4a53949d14a14386d0fd351e2d035eb">default signal mappings</a> by passing <code>handle_signals=true</code>. This is equivalent to:</p>
<div class="fragment"><div class="line">e4c_context_set_signal_mappings(e4c_default_signal_mappings);</div>
</div><!-- fragment --><dl class="section warning"><dt>Warning</dt><dd>Note that the behavior of the standard <code>signal</code> function might be undefined for a multithreaded program, so use the signal handling system with caution.</dd></dl>
<p>The convenience function <code><a class="el" href="e4c_8h.html#ad129f3e99e1483f691c8f3134f85740b" title="Prints a fatal error message regarding the specified exception. ">e4c_print_exception</a></code> will be used as the default <em>uncaught handler</em>. It will be called in the event of an uncaught exception, before exiting the program or thread. This handler can be set through the function <code><a class="el" href="e4c_8h.html#a8fae2739e3fc3823624dc35d9ea396ae" title="Sets the optional handlers of an exception context. ">e4c_context_set_handlers</a></code>.</p>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>Once <code>e4c_context_begin</code> is called, the program (or thread) <b>must</b> call <code>e4c_context_end</code> before exiting.</li>
<li>Calling <code>e4c_context_begin</code> <em>twice in a row</em> is considered a programming error, and therefore the program (or thread) will exit abruptly. Nevertheless, <code><a class="el" href="e4c_8h.html#a1e27be2186952ed77b4591f48c5d11cd" title="Begins an exception context. ">e4c_context_begin</a></code> can be called several times <em>if, and only if</em>, <code>e4c_context_end</code> is called in between.</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a7fbe6fb51b19a6485f806c006711ec74" title="Ends the current exception context. ">e4c_context_end</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a64b5cdb24278ff07e6f7767b68890473" title="Checks if the current exception context is ready. ">e4c_context_is_ready</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a27678c11fa7d4e2a9436f527cc194013" title="Introduces a block of code which will use a new exception context. ">e4c_using_context</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a67bf2b56660b4ddba6a66f7a54c4befd" title="Reuses an existing exception context, otherwise, begins a new one and then ends it. ">e4c_reusing_context</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a06e18483913c9112424bc941e248a532" title="Represents a function which will be executed in the event of an uncaught exception. ">e4c_uncaught_handler</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#ad129f3e99e1483f691c8f3134f85740b" title="Prints a fatal error message regarding the specified exception. ">e4c_print_exception</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a8fae2739e3fc3823624dc35d9ea396ae" title="Sets the optional handlers of an exception context. ">e4c_context_set_handlers</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a7fbe6fb51b19a6485f806c006711ec74"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void e4c_context_end </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname">)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Ends the current exception context. </p>
<p>This function ends the current exception context.</p>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>A program (or thread) <b>must</b> begin an exception context prior to calling <code>e4c_context_end</code>. Such programming error will lead to an abrupt exit of the program (or thread).</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a1e27be2186952ed77b4591f48c5d11cd" title="Begins an exception context. ">e4c_context_begin</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a64b5cdb24278ff07e6f7767b68890473" title="Checks if the current exception context is ready. ">e4c_context_is_ready</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a27678c11fa7d4e2a9436f527cc194013" title="Introduces a block of code which will use a new exception context. ">e4c_using_context</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a67bf2b56660b4ddba6a66f7a54c4befd" title="Reuses an existing exception context, otherwise, begins a new one and then ends it. ">e4c_reusing_context</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a7290cbfb8abb0b2ecf338cdb4de5d6df"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__signal__mapping.html">e4c_signal_mapping</a>* e4c_context_get_signal_mappings </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname">)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieves the signal mappings for the current exception context. </p>
<dl class="section return"><dt>Returns</dt><dd>The current array of mappings</dd></dl>
<p>This function retrieves the current array of mappings between the signals to be handled and the corresponding exception to be thrown.</p>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>A program (or thread) <b>must</b> begin an exception context prior to calling <code>e4c_context_get_signal_mappings</code>. Such programming error will lead to an abrupt exit of the program (or thread).</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a8a4c54a4d7cd10568b639749e8ec0e1f" title="Assigns the specified signal mappings to the exception context. ">e4c_context_set_signal_mappings</a> </dd>
<dd>
<a class="el" href="structe4c__signal__mapping.html" title="Represents a map between a signal and an exception. ">e4c_signal_mapping</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#ac4a53949d14a14386d0fd351e2d035eb" title="The array of predefined signal mappings. ">e4c_default_signal_mappings</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a64b5cdb24278ff07e6f7767b68890473"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool e4c_context_is_ready </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname">)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checks if the current exception context is ready. </p>
<dl class="section return"><dt>Returns</dt><dd>Whether the current exception context of the program (or current thread) is ready to be used.</dd></dl>
<p>This function returns whether there is an actual exception context ready to be used by the program or current thread.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a1e27be2186952ed77b4591f48c5d11cd" title="Begins an exception context. ">e4c_context_begin</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a7fbe6fb51b19a6485f806c006711ec74" title="Ends the current exception context. ">e4c_context_end</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a27678c11fa7d4e2a9436f527cc194013" title="Introduces a block of code which will use a new exception context. ">e4c_using_context</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a67bf2b56660b4ddba6a66f7a54c4befd" title="Reuses an existing exception context, otherwise, begins a new one and then ends it. ">e4c_reusing_context</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a8fae2739e3fc3823624dc35d9ea396ae"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void e4c_context_set_handlers </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="e4c_8h.html#a06e18483913c9112424bc941e248a532">e4c_uncaught_handler</a>&#160;</td>
          <td class="paramname"><em>uncaught_handler</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>custom_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="e4c_8h.html#a8ca7a4f5a33acd2bb2ed30a8d9b441de">e4c_initialize_handler</a>&#160;</td>
          <td class="paramname"><em>initialize_handler</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="e4c_8h.html#ad8b769fde61d9bc8154bff6939331042">e4c_finalize_handler</a>&#160;</td>
          <td class="paramname"><em>finalize_handler</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the optional handlers of an exception context. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uncaught_handler</td><td>The function to be executed in the event of an uncaught exception </td></tr>
    <tr><td class="paramname">custom_data</td><td>The initial value assigned to the custom_data of a new exception </td></tr>
    <tr><td class="paramname">initialize_handler</td><td>The function to be executed whenever a new exception is thrown </td></tr>
    <tr><td class="paramname">finalize_handler</td><td>The function to be executed whenever an exception is destroyed</td></tr>
  </table>
  </dd>
</dl>
<p>These handlers are a means of customizing the behavior of the exception system. For example, you can specify what needs to be done when a thrown exception is not caught (and thus, the program or thread is about to end) by calling <code>e4c_context_set_handlers</code> with your own <a class="el" href="e4c_8h.html#a06e18483913c9112424bc941e248a532">uncaught handler</a>.</p>
<p>You can also control the <a class="el" href="structe4c__exception.html#afdff5af3161edda0a23bf19de1764f74">custom data</a> attached to any new exception by specifying any or all of these:</p>
<ul>
<li>The <em>initial value</em> to be assigned to the <code>custom_data</code></li>
<li>The function to <em>initialize</em> the <code>custom_data</code></li>
<li>The function to <em>finalize</em> the <code>custom_data</code></li>
</ul>
<p>When these handlers are defined, they will be called anytime an exception is uncaught, created or destroyed. You can use them to meet your specific needs. For example, you could...</p>
<ul>
<li>...send an e-mail whenever an exception is uncaught</li>
<li>...log any thrown exception to a file</li>
<li>...capture the call stack in order to print it later on</li>
<li>...go for something completely different ;)</li>
</ul>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>A program (or thread) <b>must</b> begin an exception context prior to calling <code>e4c_context_set_handlers</code>. Such programming error will lead to an abrupt exit of the program (or thread).</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a06e18483913c9112424bc941e248a532" title="Represents a function which will be executed in the event of an uncaught exception. ">e4c_uncaught_handler</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a8ca7a4f5a33acd2bb2ed30a8d9b441de" title="Represents a function which will be executed whenever a new exception is thrown. ">e4c_initialize_handler</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#ad8b769fde61d9bc8154bff6939331042" title="Represents a function which will be executed whenever an exception is destroyed. ">e4c_finalize_handler</a> </dd>
<dd>
<a class="el" href="structe4c__exception.html" title="Represents an instance of an exception type. ">e4c_exception</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#ad129f3e99e1483f691c8f3134f85740b" title="Prints a fatal error message regarding the specified exception. ">e4c_print_exception</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a8a4c54a4d7cd10568b639749e8ec0e1f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void e4c_context_set_signal_mappings </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structe4c__signal__mapping.html">e4c_signal_mapping</a> *&#160;</td>
          <td class="paramname"><em>mappings</em>)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Assigns the specified signal mappings to the exception context. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mappings</td><td>The array of mappings</td></tr>
  </table>
  </dd>
</dl>
<p>This function assigns an array of mappings between the signals to be handled and the corresponding exception to be thrown.</p>
<dl class="section warning"><dt>Warning</dt><dd>Note that the behavior of the standard <code>signal</code> function might be undefined for a multithreaded program, so use the signal handling system with caution.</dd></dl>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>A program (or thread) <b>must</b> begin an exception context prior to calling <code>e4c_context_set_signal_mappings</code>. Such programming error will lead to an abrupt exit of the program (or thread).</li>
<li><code>mappings</code> <b>must</b> be terminated by <code><a class="el" href="e4c_8h.html#ad9a799b298c1f39c427364bfc7bfb230" title="Represents a null signal mapping literal. ">E4C_NULL_SIGNAL_MAPPING</a></code>.</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a7290cbfb8abb0b2ecf338cdb4de5d6df" title="Retrieves the signal mappings for the current exception context. ">e4c_context_get_signal_mappings</a> </dd>
<dd>
<a class="el" href="structe4c__signal__mapping.html" title="Represents a map between a signal and an exception. ">e4c_signal_mapping</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#ac4a53949d14a14386d0fd351e2d035eb" title="The array of predefined signal mappings. ">e4c_default_signal_mappings</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ab67ff2dbcdda36ef766b096e7198614d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception.html">e4c_exception</a>* e4c_get_exception </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname">)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the exception that was thrown. </p>
<dl class="section return"><dt>Returns</dt><dd>The exception that was thrown in the current exception context (if any) otherwise <code>NULL</code></dd></dl>
<p>This function returns a pointer to the exception that was thrown in the surrounding <em>exception-aware</em> block, if any; otherwise <code>NULL</code>.</p>
<p>The function <code><a class="el" href="e4c_8h.html#a3f6c1f7c7b0765e1caea7fcda7641317" title="Returns whether an exception instance is of a given type. ">e4c_is_instance_of</a></code> will determine if the thrown exception is an instance of any of the defined exception types. The <code>type</code> of the thrown exception can also be compared for an exact type match.</p>
<div class="fragment"><div class="line"><span class="keywordflow">try</span>{</div>
<div class="line">   ...</div>
<div class="line">}<span class="keywordflow">catch</span>(RuntimeException){</div>
<div class="line">   <span class="keyword">const</span> <a class="code" href="structe4c__exception.html" title="Represents an instance of an exception type. ">e4c_exception</a> * exception = e4c_get_exception();</div>
<div class="line">   <span class="keywordflow">if</span>( e4c_is_instance_of(exception, &amp;SignalException) ){</div>
<div class="line">       ...</div>
<div class="line">   }<span class="keywordflow">else</span> <span class="keywordflow">if</span>(exception-&gt;<a class="code" href="structe4c__exception.html#ad50162f7a5b6dd677286f5c31af79655" title="The type of this exception. ">type</a> == &amp;NotEnoughMemoryException){</div>
<div class="line">       ...</div>
<div class="line">   }</div>
<div class="line">}</div>
</div><!-- fragment --><p>The thrown exception can be obtained any time, provided that the exception context has begun at the time of the function call. However, it is sensible to call this function only during the execution of <code><a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a></code> or <code><a class="el" href="e4c_8h.html#a629585c5169ebdb440b9015f8e87b4df" title="Introduces a block of code capable of handling a specific type of exceptions. ">catch</a></code> blocks.</p>
<p>Moreover, a pointer to the thrown exception obtained <em>inside</em> a <code><a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a></code> or <code><a class="el" href="e4c_8h.html#a629585c5169ebdb440b9015f8e87b4df" title="Introduces a block of code capable of handling a specific type of exceptions. ">catch</a></code> block <b>must not</b> be used <em>outside</em> these blocks.</p>
<p>The exception system objects are dinamically allocated and deallocated, as the program enters or exits <code><a class="el" href="e4c_8h.html#a28599e8ac99ea9faff60a2258a914aee" title="Introduces a block of code aware of exceptions. ">try</a></code>... <code><a class="el" href="e4c_8h.html#a629585c5169ebdb440b9015f8e87b4df" title="Introduces a block of code capable of handling a specific type of exceptions. ">catch</a></code>... <code><a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a></code> blocks. While it would be legal to <em>copy</em> the thrown exception and access to its <code>name</code> and <code>message</code> outside these blocks, care should be taken in order not to dereference the <code>cause</code> of the exception, unless it is a <b>deep copy</b> (as opposed to a <b>shallow copy</b>).</p>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>A program (or thread) <b>must</b> begin an exception context prior to calling <code>e4c_get_exception</code>. Such programming error will lead to an abrupt exit of the program (or thread).</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="structe4c__exception.html" title="Represents an instance of an exception type. ">e4c_exception</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a3f6c1f7c7b0765e1caea7fcda7641317" title="Returns whether an exception instance is of a given type. ">e4c_is_instance_of</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a482d649fcaafd28584629da3606e4ea7" title="Signals an exceptional situation represented by an exception object. ">throw</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a629585c5169ebdb440b9015f8e87b4df" title="Introduces a block of code capable of handling a specific type of exceptions. ">catch</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a961e9d117c98424796ae769f2b2e6b26"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50">e4c_status</a> e4c_get_status </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname">)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the completeness status of the executing code block. </p>
<dl class="section return"><dt>Returns</dt><dd>The completeness status of the executing code block</dd></dl>
<p>Exception-aware code blocks have a completeness status regarding the exception handling system. This status determines whether an exception was actually thrown or not, and whether the exception was caught or not.</p>
<p>The status of the current block can be obtained any time, provided that the exception context has begun at the time of the function call. However, it is sensible to call this function only during the execution of <code><a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a></code> blocks.</p>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li>A program (or thread) <b>must</b> begin an exception context prior to calling <code>e4c_get_status</code>. Such programming error will lead to an abrupt exit of the program (or thread).</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50" title="Represents the completeness of a code block aware of exceptions. ">e4c_status</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a3f6c1f7c7b0765e1caea7fcda7641317"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool e4c_is_instance_of </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structe4c__exception.html">e4c_exception</a> *&#160;</td>
          <td class="paramname"><em>instance</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> *&#160;</td>
          <td class="paramname"><em>exception_type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns whether an exception instance is of a given type. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">instance</td><td>The thrown exception </td></tr>
    <tr><td class="paramname">exception_type</td><td>A previously defined type of exceptions </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Whether the specified exception is an instance of the given type</dd></dl>
<p><code><a class="el" href="e4c_8h.html#a3f6c1f7c7b0765e1caea7fcda7641317" title="Returns whether an exception instance is of a given type. ">e4c_is_instance_of</a></code> can be used to determine if a thrown exception <b>is an instance of</b> a given exception type.</p>
<p>This function is intended to be used in a <code><a class="el" href="e4c_8h.html#a629585c5169ebdb440b9015f8e87b4df" title="Introduces a block of code capable of handling a specific type of exceptions. ">catch</a></code> block, or in a <code><a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a></code> block provided that some exception was actually thrown (i.e. <code><a class="el" href="e4c_8h.html#a961e9d117c98424796ae769f2b2e6b26" title="Returns the completeness status of the executing code block. ">e4c_get_status</a></code> returs <code><a class="el" href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50a3e25fc733de62745054a380444ada211" title="There was an exception and it wasn&#39;t caught. ">e4c_failed</a></code> or <code><a class="el" href="e4c_8h.html#a6cbf5662e61eccb04d74464ab3864d50a8d27c3fe156c5e88b8927a45a99903c8" title="There was an exception, but it was caught. ">e4c_recovered</a></code>).</p>
<p>This function will return <code>false</code> if either <code>instance</code> or <code>type</code> are <code>NULL</code>.</p>
<div class="fragment"><div class="line"><span class="keywordflow">try</span>{</div>
<div class="line">   ...</div>
<div class="line">}<span class="keywordflow">catch</span>(RuntimeException){</div>
<div class="line">   <span class="keyword">const</span> <a class="code" href="structe4c__exception.html" title="Represents an instance of an exception type. ">e4c_exception</a> * exception = e4c_get_exception();</div>
<div class="line">   <span class="keywordflow">if</span>( e4c_is_instance_of(exception, &amp;SignalException) ){</div>
<div class="line">       ...</div>
<div class="line">   }<span class="keywordflow">else</span> <span class="keywordflow">if</span>(exception-&gt;<a class="code" href="structe4c__exception.html#ad50162f7a5b6dd677286f5c31af79655" title="The type of this exception. ">type</a> == &amp;NotEnoughMemoryException){</div>
<div class="line">       ...</div>
<div class="line">   }</div>
<div class="line">}</div>
</div><!-- fragment --><dl class="section pre"><dt>Precondition</dt><dd><ul>
<li><code>instance</code> <b>must not</b> be <code>NULL</code></li>
<li><code>type</code> <b>must not</b> be <code>NULL</code></li>
</ul>
</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="structe4c__exception.html" title="Represents an instance of an exception type. ">e4c_exception</a> </dd>
<dd>
<a class="el" href="structe4c__exception__type.html" title="Represents an exception type in the exception handling system. ">e4c_exception_type</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#ab67ff2dbcdda36ef766b096e7198614d" title="Returns the exception that was thrown. ">e4c_get_exception</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ac84af6b4e6798e3cc98de0012dcacb7f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long e4c_library_version </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname">)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the library version number. </p>
<dl class="section return"><dt>Returns</dt><dd>The version number associated with the library</dd></dl>
<p>This function provides the same information as the <code><a class="el" href="e4c_8h.html#aaabdc92526a7fb8e02558867f3ad0cb8" title="Provides the library version number. ">E4C_VERSION_NUMBER</a></code> macro, but the returned version number is associated with the actual, compiled library.</p>
<dl class="section note"><dt>Note</dt><dd>This version number can be considered as the <em>run-time</em> library version number, as opposed to the <em>compile-time</em> library version number (specified by the header file).</dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd>The library <b>must</b> be compiled with the corresponding header (i.e. library version number should be equal to header version number).</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#aaabdc92526a7fb8e02558867f3ad0cb8" title="Provides the library version number. ">E4C_VERSION_NUMBER</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ad129f3e99e1483f691c8f3134f85740b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void e4c_print_exception </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structe4c__exception.html">e4c_exception</a> *&#160;</td>
          <td class="paramname"><em>exception</em>)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Prints a fatal error message regarding the specified exception. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">exception</td><td>The uncaught exception</td></tr>
  </table>
  </dd>
</dl>
<p>This is a convenience function for showing an error message through the standard error output. It can be passed to <code><a class="el" href="e4c_8h.html#a8fae2739e3fc3823624dc35d9ea396ae" title="Sets the optional handlers of an exception context. ">e4c_context_set_handlers</a></code> as the handler for uncaught exceptions. Will be used by default, unless otherwise set up.</p>
<p>In absence of <code>NDEBUG</code>, this function prints as much information regarding the exception as it is available, whereas in presence of <code>NDEBUG</code>, only the <code>name</code> and <code>message</code> of the exception are printed.</p>
<dl class="section pre"><dt>Precondition</dt><dd><ul>
<li><code>exception</code> <b>must not</b> be <code>NULL</code> </li>
</ul>
</dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="e4c_8h.html#ae3f89b7484efca7715d70a781d2856a8" title="This exception is thrown when an unexpected null pointer is found. ">NullPointerException</a></td><td>If <code>exception</code> is <code>NULL</code></td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a06e18483913c9112424bc941e248a532" title="Represents a function which will be executed in the event of an uncaught exception. ">e4c_uncaught_handler</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a1e27be2186952ed77b4591f48c5d11cd" title="Begins an exception context. ">e4c_context_begin</a> </dd>
<dd>
<a class="el" href="e4c_8h.html#a27678c11fa7d4e2a9436f527cc194013" title="Introduces a block of code which will use a new exception context. ">e4c_using_context</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a7b71c5d523540629e1a313bdf372b3ff"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void e4c_print_exception_type </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> *&#160;</td>
          <td class="paramname"><em>exception_type</em>)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Prints an ASCII graph representing an exception type's hierarchy. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">exception_type</td><td>An exception type</td></tr>
  </table>
  </dd>
</dl>
<p>This is a convenience function for showing an ASCII graph representing an exception type's hierarchy through the standard error output.</p>
<p>For example, the output for <code><a class="el" href="e4c_8h.html#aa262dd222a7bab5d046081ab04a39b17" title="This exception is thrown when user-defined conditions occur. ">ProgramSignal2Exception</a></code> would be:</p>
<div class="fragment"><div class="line">Exception hierarchy</div>
<div class="line">________________________________________________________________</div>
<div class="line"></div>
<div class="line">    <a class="code" href="e4c_8h.html#a07da936a74602281d601c171b77bf0b0" title="This is the root of the exception pseudo-hierarchy ">RuntimeException</a></div>
<div class="line">     |</div>
<div class="line">     +--<a class="code" href="e4c_8h.html#a7ad6290493086138a1d40a5d79cfed17" title="This exception is the common supertype of all signal exceptions. ">SignalException</a></div>
<div class="line">         |</div>
<div class="line">         +--<a class="code" href="e4c_8h.html#af41f0d1ad6046025d27c75003a453081" title="This exception is the common supertype of all user-defined signal exceptions. ">ProgramSignalException</a></div>
<div class="line">             |</div>
<div class="line">             +--<a class="code" href="e4c_8h.html#aa262dd222a7bab5d046081ab04a39b17" title="This exception is thrown when user-defined conditions occur. ">ProgramSignal2Exception</a></div>
<div class="line">________________________________________________________________</div>
</div><!-- fragment --><dl class="section pre"><dt>Precondition</dt><dd><ul>
<li><code>exception_type</code> <b>must not</b> be <code>NULL</code> </li>
</ul>
</dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="e4c_8h.html#ae3f89b7484efca7715d70a781d2856a8" title="This exception is thrown when an unexpected null pointer is found. ">NullPointerException</a></td><td>If <code>exception_type</code> is <code>NULL</code></td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="structe4c__exception__type.html" title="Represents an exception type in the exception handling system. ">e4c_exception_type</a> </dd></dl>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="aa5e036c578fdf7577287f547cbc75234"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> AbortException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown to abort the process. </p>
<p><code><a class="el" href="e4c_8h.html#aa5e036c578fdf7577287f547cbc75234" title="This exception is thrown to abort the process. ">AbortException</a></code> represents <code>SIGABRT</code>, the signal sent by computer programs to abort the process.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#a68c1b7bb934db83c6b996a535b5dbc95" title="This exception is the common supertype of all control signal exceptions. ">ControlSignalException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a6fcf200100e1cfde147d444aefe5cdb5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> ArithmeticException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown when the process performs an erroneous arithmetic operation. </p>
<p><code><a class="el" href="e4c_8h.html#a6fcf200100e1cfde147d444aefe5cdb5" title="This exception is thrown when the process performs an erroneous arithmetic operation. ">ArithmeticException</a></code> represents <code>SIGFPE</code>, the signal sent to a process when it performs an erroneous arithmetic operation.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#ab7b4334cedd9dd92aa16f583dabd94d0" title="This exception is the common supertype of all error signal exceptions. ">ErrorSignalException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a64df4b96937a949466d55b5638c5b9cf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> AssertionException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown when an assertion does not hold. </p>
<p><code><a class="el" href="e4c_8h.html#a64df4b96937a949466d55b5638c5b9cf" title="This exception is thrown when an assertion does not hold. ">AssertionException</a></code> is part of the assertion facility of the library. It is thrown when the <em>compile-time</em> parameter <code>NDEBUG</code> is present and the conditon of an assertion evaluates to <code>false</code>.</p>
<dl class="section remark"><dt>Remarks</dt><dd>This exception cannot be caught whatsoever. The program (or current thread) will be terminated, after the execution of all pending <code><a class="el" href="e4c_8h.html#a6f547472794c162cc629f53cd4db5454" title="Introduces a block of code responsible for cleaning up the previous exception-aware block...">finally</a></code> blocks.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#acdcc5aaebf3f273c1762f24a6ece2e5e" title="Expresses a program assertion. ">assert</a> </dd></dl>

</div>
</div>
<a class="anchor" id="aae2c0f060628a75c117ff4bf75f2804f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> BadPointerException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown when the process tries to dereference an invalid pointer. </p>
<p><code><a class="el" href="e4c_8h.html#aae2c0f060628a75c117ff4bf75f2804f" title="This exception is thrown when the process tries to dereference an invalid pointer. ">BadPointerException</a></code> represents <code>SIGSEGV</code>, the signal sent to a process when it makes an invalid memory reference, or segmentation fault.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#ab7b4334cedd9dd92aa16f583dabd94d0" title="This exception is the common supertype of all error signal exceptions. ">ErrorSignalException</a></dd></dl>
<dl class="section user"><dt>Direct known subexceptions:</dt><dd><a class="el" href="e4c_8h.html#ae3f89b7484efca7715d70a781d2856a8" title="This exception is thrown when an unexpected null pointer is found. ">NullPointerException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a14d711083b9740a7188cbe9f2f915d4f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> BrokenPipeException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown when the process attempts to write to a broken pipe. </p>
<p><code><a class="el" href="e4c_8h.html#a14d711083b9740a7188cbe9f2f915d4f" title="This exception is thrown when the process attempts to write to a broken pipe. ">BrokenPipeException</a></code> represents <code>SIGPIPE</code>, the signal sent to a process when it attempts to write to a pipe without a process connected to the other end.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#ab7b4334cedd9dd92aa16f583dabd94d0" title="This exception is the common supertype of all error signal exceptions. ">ErrorSignalException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a68c1b7bb934db83c6b996a535b5dbc95"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> ControlSignalException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is the common supertype of all control signal exceptions. </p>
<p>Control signal exceptions are thrown when the process needs to be controlled by the user or some other process.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#a7ad6290493086138a1d40a5d79cfed17" title="This exception is the common supertype of all signal exceptions. ">SignalException</a></dd></dl>
<dl class="section user"><dt>Direct known subexceptions:</dt><dd><a class="el" href="e4c_8h.html#a94f5ec0761d8c1dc9a8d2355f1348570" title="This exception is thrown to stop the process for later resumption. ">StopException</a>, <a class="el" href="e4c_8h.html#a6af0a9ec525ab5af8a4442a79dcaca70" title="This exception is thrown to terminate the process immediately. ">KillException</a>, <a class="el" href="e4c_8h.html#a4766c592882555f4091cb9060f10ab5c" title="This exception is thrown when the process&#39; terminal is closed. ">HangUpException</a>, <a class="el" href="e4c_8h.html#a85b12608ec4e14046622ebcaf38b925e" title="This exception is thrown to request the termination of the process. ">TerminationException</a>, <a class="el" href="e4c_8h.html#aa5e036c578fdf7577287f547cbc75234" title="This exception is thrown to abort the process. ">AbortException</a>, <a class="el" href="e4c_8h.html#a51e3faa8033827a201cb162c52191a84" title="This exception is thrown when the process has used up the CPU for too long. ">CPUTimeException</a>, <a class="el" href="e4c_8h.html#afe03611168e7eed8a894066663f3e41e" title="This exception is the common supertype of all control signal exceptions caused by the user...">UserControlSignalException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a51e3faa8033827a201cb162c52191a84"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> CPUTimeException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown when the process has used up the CPU for too long. </p>
<p><code><a class="el" href="e4c_8h.html#a51e3faa8033827a201cb162c52191a84" title="This exception is thrown when the process has used up the CPU for too long. ">CPUTimeException</a></code> represents <code>SIGXCPU</code>, the signal sent to a process when it has used up the CPU for a duration that exceeds a certain predetermined user-settable value.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#a68c1b7bb934db83c6b996a535b5dbc95" title="This exception is the common supertype of all control signal exceptions. ">ControlSignalException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ac4a53949d14a14386d0fd351e2d035eb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__signal__mapping.html">e4c_signal_mapping</a>* const e4c_default_signal_mappings</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The array of predefined signal mappings. </p>

</div>
</div>
<a class="anchor" id="ab7b4334cedd9dd92aa16f583dabd94d0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> ErrorSignalException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is the common supertype of all error signal exceptions. </p>
<p>Error signal exceptions are thrown when some error prevents the program to keep executing its normal flow.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#a7ad6290493086138a1d40a5d79cfed17" title="This exception is the common supertype of all signal exceptions. ">SignalException</a></dd></dl>
<dl class="section user"><dt>Direct known subexceptions:</dt><dd><a class="el" href="e4c_8h.html#a1f8767c09f8776465bab2fbf17e178dd" title="This exception is thrown when the process attempts to execute an illegal instruction. ">IllegalInstructionException</a>, <a class="el" href="e4c_8h.html#aae2c0f060628a75c117ff4bf75f2804f" title="This exception is thrown when the process tries to dereference an invalid pointer. ">BadPointerException</a>, <a class="el" href="e4c_8h.html#a6fcf200100e1cfde147d444aefe5cdb5" title="This exception is thrown when the process performs an erroneous arithmetic operation. ">ArithmeticException</a>, <a class="el" href="e4c_8h.html#a14d711083b9740a7188cbe9f2f915d4f" title="This exception is thrown when the process attempts to write to a broken pipe. ">BrokenPipeException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a4766c592882555f4091cb9060f10ab5c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> HangUpException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown when the process' terminal is closed. </p>
<p><code><a class="el" href="e4c_8h.html#a4766c592882555f4091cb9060f10ab5c" title="This exception is thrown when the process&#39; terminal is closed. ">HangUpException</a></code> represents <code>SIGHUP</code>, the signal sent to a process when its controlling terminal is closed.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#a68c1b7bb934db83c6b996a535b5dbc95" title="This exception is the common supertype of all control signal exceptions. ">ControlSignalException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a1e4eb23ca08a70129f1a5076f37dce3e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> IllegalArgumentException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown when a function is passed an illegal or inappropriate argument. </p>
<p><code><a class="el" href="e4c_8h.html#a1e4eb23ca08a70129f1a5076f37dce3e" title="This exception is thrown when a function is passed an illegal or inappropriate argument. ">IllegalArgumentException</a></code> is thrown by a function when it detects that some of the function parameters (passed by the caller) is unacceptable.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#a07da936a74602281d601c171b77bf0b0" title="This is the root of the exception pseudo-hierarchy ">RuntimeException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a1f8767c09f8776465bab2fbf17e178dd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> IllegalInstructionException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown when the process attempts to execute an illegal instruction. </p>
<p><code><a class="el" href="e4c_8h.html#a1f8767c09f8776465bab2fbf17e178dd" title="This exception is thrown when the process attempts to execute an illegal instruction. ">IllegalInstructionException</a></code> represents <code>SIGILL</code>, the signal sent to a process when it attempts to execute a malformed, unknown, or privileged instruction.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#ab7b4334cedd9dd92aa16f583dabd94d0" title="This exception is the common supertype of all error signal exceptions. ">ErrorSignalException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a4ee8b42ef10e5adf967761811823150c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> InputOutputException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown when an input/output error occurs. </p>
<p><code><a class="el" href="e4c_8h.html#a4ee8b42ef10e5adf967761811823150c" title="This exception is thrown when an input/output error occurs. ">InputOutputException</a></code> is the general type of exceptions produced by failed or interrupted I/O operations.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#a07da936a74602281d601c171b77bf0b0" title="This is the root of the exception pseudo-hierarchy ">RuntimeException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a6af0a9ec525ab5af8a4442a79dcaca70"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> KillException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown to terminate the process immediately. </p>
<p><code><a class="el" href="e4c_8h.html#a6af0a9ec525ab5af8a4442a79dcaca70" title="This exception is thrown to terminate the process immediately. ">KillException</a></code> represents <code>SIGKILL</code>, the signal sent to a process to cause it to terminate immediately.</p>
<dl class="section remark"><dt>Remarks</dt><dd>Since <code>SIGKILL</code> is usually unblock-able, it won't be handled and converted to this exception automatically on some platforms.</dd></dl>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#a68c1b7bb934db83c6b996a535b5dbc95" title="This exception is the common supertype of all control signal exceptions. ">ControlSignalException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="add75d60a1beb6be775c7199b58c8bf49"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> NotEnoughMemoryException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown when the system runs out of memory. </p>
<p><code><a class="el" href="e4c_8h.html#add75d60a1beb6be775c7199b58c8bf49" title="This exception is thrown when the system runs out of memory. ">NotEnoughMemoryException</a></code> is thrown when there is not enough memory to continue the execution of the program.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#a07da936a74602281d601c171b77bf0b0" title="This is the root of the exception pseudo-hierarchy ">RuntimeException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ae3f89b7484efca7715d70a781d2856a8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> NullPointerException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown when an unexpected null pointer is found. </p>
<p><code><a class="el" href="e4c_8h.html#ae3f89b7484efca7715d70a781d2856a8" title="This exception is thrown when an unexpected null pointer is found. ">NullPointerException</a></code> is thrown when some part of the program gets a pointer which was expected or required to contain a valid memory address.</p>
<p>A <em>null</em> pointer exception is a special case of a <em>bad</em> pointer exception. The difference between them is that <code><a class="el" href="e4c_8h.html#ae3f89b7484efca7715d70a781d2856a8" title="This exception is thrown when an unexpected null pointer is found. ">NullPointerException</a></code> needs to be thrown <em>explicitly</em> by some function, while <code><a class="el" href="e4c_8h.html#aae2c0f060628a75c117ff4bf75f2804f" title="This exception is thrown when the process tries to dereference an invalid pointer. ">BadPointerException</a></code> is thrown <em>implicitly</em> by the signal handling system (if enabled).</p>
<dl class="section note"><dt>Note</dt><dd>Sometimes, a null pointer exception can also be considered as a special case of an <em>illegal argument</em> exception.</dd></dl>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#aae2c0f060628a75c117ff4bf75f2804f" title="This exception is thrown when the process tries to dereference an invalid pointer. ">BadPointerException</a></dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="e4c_8h.html#a1e4eb23ca08a70129f1a5076f37dce3e" title="This exception is thrown when a function is passed an illegal or inappropriate argument. ">IllegalArgumentException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ad99590ee7828c20bdd516ac0fb3cbd48"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> ProgramSignal1Exception</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown when user-defined conditions occur. </p>
<p><code><a class="el" href="e4c_8h.html#ad99590ee7828c20bdd516ac0fb3cbd48" title="This exception is thrown when user-defined conditions occur. ">ProgramSignal1Exception</a></code> represents <code>SIGUSR1</code>, the signal sent to a process to indicate user-defined conditions.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#af41f0d1ad6046025d27c75003a453081" title="This exception is the common supertype of all user-defined signal exceptions. ">ProgramSignalException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="aa262dd222a7bab5d046081ab04a39b17"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> ProgramSignal2Exception</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown when user-defined conditions occur. </p>
<p><code><a class="el" href="e4c_8h.html#aa262dd222a7bab5d046081ab04a39b17" title="This exception is thrown when user-defined conditions occur. ">ProgramSignal2Exception</a></code> represents <code>SIGUSR1</code>, the signal sent to a process to indicate user-defined conditions.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#af41f0d1ad6046025d27c75003a453081" title="This exception is the common supertype of all user-defined signal exceptions. ">ProgramSignalException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="af41f0d1ad6046025d27c75003a453081"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> ProgramSignalException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is the common supertype of all user-defined signal exceptions. </p>
<p>User-defined signal exceptions are thrown to indicate user-defined conditions.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#a7ad6290493086138a1d40a5d79cfed17" title="This exception is the common supertype of all signal exceptions. ">SignalException</a></dd></dl>
<dl class="section user"><dt>Direct known subexceptions:</dt><dd><a class="el" href="e4c_8h.html#ad99590ee7828c20bdd516ac0fb3cbd48" title="This exception is thrown when user-defined conditions occur. ">ProgramSignal1Exception</a>, <a class="el" href="e4c_8h.html#aa262dd222a7bab5d046081ab04a39b17" title="This exception is thrown when user-defined conditions occur. ">ProgramSignal2Exception</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a07da936a74602281d601c171b77bf0b0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> RuntimeException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is the root of the exception <em>pseudo-hierarchy</em> </p>
<p><code><a class="el" href="e4c_8h.html#a07da936a74602281d601c171b77bf0b0" title="This is the root of the exception pseudo-hierarchy ">RuntimeException</a></code> is the common <em>supertype</em> of all exceptions.</p>
<dl class="section user"><dt>Direct known subexceptions:</dt><dd><a class="el" href="e4c_8h.html#add75d60a1beb6be775c7199b58c8bf49" title="This exception is thrown when the system runs out of memory. ">NotEnoughMemoryException</a>, <a class="el" href="e4c_8h.html#a64df4b96937a949466d55b5638c5b9cf" title="This exception is thrown when an assertion does not hold. ">AssertionException</a>, <a class="el" href="e4c_8h.html#a1e4eb23ca08a70129f1a5076f37dce3e" title="This exception is thrown when a function is passed an illegal or inappropriate argument. ">IllegalArgumentException</a>, <a class="el" href="e4c_8h.html#a4ee8b42ef10e5adf967761811823150c" title="This exception is thrown when an input/output error occurs. ">InputOutputException</a>, <a class="el" href="e4c_8h.html#a7ad6290493086138a1d40a5d79cfed17" title="This exception is the common supertype of all signal exceptions. ">SignalException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="af7c8a584138805cdd58fc268fc8125a8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> SignalAlarmException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown when a time limit has elapsed. </p>
<p><code><a class="el" href="e4c_8h.html#af7c8a584138805cdd58fc268fc8125a8" title="This exception is thrown when a time limit has elapsed. ">SignalAlarmException</a></code> represents <code>SIGALRM</code>, the signal sent to a process when a time limit has elapsed.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#a7ad6290493086138a1d40a5d79cfed17" title="This exception is the common supertype of all signal exceptions. ">SignalException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="aa9705f1bf72752040cb1faefd741af75"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> SignalChildException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown when a child process terminates. </p>
<p><code><a class="el" href="e4c_8h.html#aa9705f1bf72752040cb1faefd741af75" title="This exception is thrown when a child process terminates. ">SignalChildException</a></code> represents <code>SIGCHLD</code>, the signal sent to a process when a child process terminates.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#a7ad6290493086138a1d40a5d79cfed17" title="This exception is the common supertype of all signal exceptions. ">SignalException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a7ad6290493086138a1d40a5d79cfed17"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> SignalException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is the common supertype of all signal exceptions. </p>
<p>Signal exceptions are thrown when some signal is sent to the process.</p>
<p>A signal can be generated by calling <code>raise</code>.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#a07da936a74602281d601c171b77bf0b0" title="This is the root of the exception pseudo-hierarchy ">RuntimeException</a></dd></dl>
<dl class="section user"><dt>Direct known subexceptions:</dt><dd><a class="el" href="e4c_8h.html#a7ad6290493086138a1d40a5d79cfed17" title="This exception is the common supertype of all signal exceptions. ">SignalException</a>, <a class="el" href="e4c_8h.html#af7c8a584138805cdd58fc268fc8125a8" title="This exception is thrown when a time limit has elapsed. ">SignalAlarmException</a>, <a class="el" href="e4c_8h.html#aa9705f1bf72752040cb1faefd741af75" title="This exception is thrown when a child process terminates. ">SignalChildException</a>, <a class="el" href="e4c_8h.html#a14e2d961b990ea9b03bc867c7c7236df" title="This exception is thrown when a condition arises that a debugger has requested to be informed of...">SignalTrapException</a>, <a class="el" href="e4c_8h.html#ab7b4334cedd9dd92aa16f583dabd94d0" title="This exception is the common supertype of all error signal exceptions. ">ErrorSignalException</a>, <a class="el" href="e4c_8h.html#a68c1b7bb934db83c6b996a535b5dbc95" title="This exception is the common supertype of all control signal exceptions. ">ControlSignalException</a>, <a class="el" href="e4c_8h.html#af41f0d1ad6046025d27c75003a453081" title="This exception is the common supertype of all user-defined signal exceptions. ">ProgramSignalException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a14e2d961b990ea9b03bc867c7c7236df"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> SignalTrapException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown when a condition arises that a debugger has requested to be informed of. </p>
<p><code><a class="el" href="e4c_8h.html#a14e2d961b990ea9b03bc867c7c7236df" title="This exception is thrown when a condition arises that a debugger has requested to be informed of...">SignalTrapException</a></code> represents <code>SIGTRAP</code>, the signal sent to a process when a condition arises that a debugger has requested to be informed of.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#a7ad6290493086138a1d40a5d79cfed17" title="This exception is the common supertype of all signal exceptions. ">SignalException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a94f5ec0761d8c1dc9a8d2355f1348570"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> StopException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown to stop the process for later resumption. </p>
<p><code><a class="el" href="e4c_8h.html#a94f5ec0761d8c1dc9a8d2355f1348570" title="This exception is thrown to stop the process for later resumption. ">StopException</a></code> represents <code>SIGSTOP</code>, the signal sent to a process to stop it for later resumption.</p>
<dl class="section remark"><dt>Remarks</dt><dd>Since <code>SIGSTOP</code> is usually unblock-able, it won't be handled and converted to this exception automatically on some platforms.</dd></dl>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#a68c1b7bb934db83c6b996a535b5dbc95" title="This exception is the common supertype of all control signal exceptions. ">ControlSignalException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a85b12608ec4e14046622ebcaf38b925e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> TerminationException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown to request the termination of the process. </p>
<p><code><a class="el" href="e4c_8h.html#a85b12608ec4e14046622ebcaf38b925e" title="This exception is thrown to request the termination of the process. ">TerminationException</a></code> represents <code>SIGTERM</code>, the signal sent to a process to request its termination.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#a68c1b7bb934db83c6b996a535b5dbc95" title="This exception is the common supertype of all control signal exceptions. ">ControlSignalException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ac349a1072bfaf69546a8eee5ecd48974"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> UserBreakException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown when a user wishes to break the process. </p>
<p><code><a class="el" href="e4c_8h.html#ac349a1072bfaf69546a8eee5ecd48974" title="This exception is thrown when a user wishes to break the process. ">UserBreakException</a></code> represents <code>SIGBREAK</code>, the signal sent to a process by its controlling terminal when a user wishes to break it.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#afe03611168e7eed8a894066663f3e41e" title="This exception is the common supertype of all control signal exceptions caused by the user...">UserControlSignalException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="afe03611168e7eed8a894066663f3e41e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> UserControlSignalException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is the common supertype of all control signal exceptions caused by the user. </p>
<p>User control signal exceptions are thrown when the process needs to be controlled by the user.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#a68c1b7bb934db83c6b996a535b5dbc95" title="This exception is the common supertype of all control signal exceptions. ">ControlSignalException</a></dd></dl>
<dl class="section user"><dt>Direct known subexceptions:</dt><dd><a class="el" href="e4c_8h.html#a11a68cf0fcba3fb1a2dd7250d7ceed8c" title="This exception is thrown when the user requests to quit the process. ">UserQuitException</a>, <a class="el" href="e4c_8h.html#a7ae85ae6281b40b4419ae8ac4cc6623b" title="This exception is thrown when the user requests to interrupt the process. ">UserInterruptionException</a>, <a class="el" href="e4c_8h.html#ac349a1072bfaf69546a8eee5ecd48974" title="This exception is thrown when a user wishes to break the process. ">UserBreakException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a7ae85ae6281b40b4419ae8ac4cc6623b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> UserInterruptionException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown when the user requests to interrupt the process. </p>
<p><code><a class="el" href="e4c_8h.html#a7ae85ae6281b40b4419ae8ac4cc6623b" title="This exception is thrown when the user requests to interrupt the process. ">UserInterruptionException</a></code> represents <code>SIGINT</code>, the signal sent to a process by its controlling terminal when a user wishes to interrupt it.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#afe03611168e7eed8a894066663f3e41e" title="This exception is the common supertype of all control signal exceptions caused by the user...">UserControlSignalException</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a11a68cf0fcba3fb1a2dd7250d7ceed8c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structe4c__exception__type.html">e4c_exception_type</a> UserQuitException</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This exception is thrown when the user requests to quit the process. </p>
<p><code><a class="el" href="e4c_8h.html#a11a68cf0fcba3fb1a2dd7250d7ceed8c" title="This exception is thrown when the user requests to quit the process. ">UserQuitException</a></code> represents <code>SIGQUIT</code>, the signal sent to a process by its controlling terminal when the user requests that the process dump core.</p>
<dl class="section user"><dt>Extends:</dt><dd><a class="el" href="e4c_8h.html#afe03611168e7eed8a894066663f3e41e" title="This exception is the common supertype of all control signal exceptions caused by the user...">UserControlSignalException</a> </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.4-->
<!-- start footer part -->
			<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
			  <ul>
				<li class="navelem"><a class="el" href="e4c_8h.html">e4c.h</a></li>
				<li class="footer">
					<a href="https://code.google.com/p/exceptions4c/" title="exceptions4c version 3.0">
						<img src="sheep_016.png" width="16" height="16" alt="" style="vertical-align: text-bottom;" />
						<strong>exceptions4c</strong>
					</a>
					Reference Documentation
					Generated by
					<a href="http://www.doxygen.org/index.html" title="doxygen 1.8.4">
						<strong>doxygen</strong>
					</a>
				</li>
			  </ul>
			</div>
	</body>
</html>
